  :root {
    --bg: #f4f4f2;
    --ink: #1a1a1a;
    --faint: #8a8a8a;
    --line: #1a1a1a;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { background: var(--bg); }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    max-width: 920px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 26px 22px 120px;
    position: relative;
  }
  a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
    cursor: pointer;
    background: none; border: none; font: inherit;
    transition: opacity .15s ease;
  }
  a:hover { opacity: .55; }
  header { margin-bottom: 40px; }
  #topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
  .site-title { font-size: 18px; font-weight: 600; letter-spacing: .02em; }
  .tb-right { display: flex; align-items: center; gap: 20px; }
  .icon-btn {
    background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer;
    color: var(--ink); padding: 2px; transition: opacity .15s ease, transform .15s ease;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .icon-btn:hover { opacity: .6; transform: rotate(25deg); }
  .plus {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink);
    background: var(--ink); color: #fff; font-size: 22px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease, opacity .15s ease;
  }
  .plus:hover { transform: scale(1.08); opacity: .88; }

  /* card grid (home) */
  #feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 34px 24px;
    max-width: 840px; margin: 0 auto;
  }
  .card { cursor: pointer; position: relative; }
  .card .menu-btn {
    position: absolute; top: 6px; right: 2px;
    background: none; border: none; font-size: 16px; cursor: pointer;
    color: var(--faint); padding: 2px 6px;
    opacity: 0; transition: opacity .15s ease, color .15s ease;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .card:hover .menu-btn, .card .menu-btn:focus { opacity: 1; }
  .card .menu-btn:hover { color: var(--ink); }
  .card-photo {
    width: 100%; aspect-ratio: 3 / 4; display: block;
    border: 1px solid var(--ink); image-rendering: pixelated; object-fit: cover;
    transition: opacity .2s ease, transform .2s ease;
  }
  .card:hover .card-photo { opacity: .86; transform: scale(1.015); }
  .card-photo.empty {
    display: flex; align-items: center; justify-content: center;
    color: var(--faint); font-size: 13px;
  }
  .card-date {
    color: #8f8f8a; font-size: 12.5px; margin-top: 8px;
    font-variant-numeric: tabular-nums; transition: color .15s ease;
  }
  .card:hover .card-date { color: var(--ink); }
  @media (max-width: 599px) {
    #feed { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  }

  /* detail view */
  #detailView { display: none; max-width: 480px; margin: 60px auto 0; }
  #detailBack {
    position: absolute; top: 20px; left: 18px; font-size: 14.5px;
    cursor: pointer; text-decoration: none; color: var(--ink);
  }
  #detailBack { display: inline-flex; align-items: center; }
  #detailBack .arr { margin-right: 6px; display: inline-flex; align-items: center; }
  .entry { margin: 0 8px 88px; scroll-margin-top: 40px; }
  .entry-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 14px; font-size: 15.5px;
  }
  .entry-head .menu-btn {
    background: none; border: none; font-size: 18px; cursor: pointer;
    color: var(--faint); padding: 0 2px;
    transition: color .15s ease;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .entry-head .menu-btn:hover { color: var(--ink); }
  .entry .place { font-size: 13.5px; color: var(--faint); margin-bottom: 12px; }
  .entry img {
    width: 100%; display: block;
    border: 1px solid var(--ink);
    image-rendering: pixelated;
  }
  .entry .body { margin-top: 14px; font-size: 15.5px; white-space: pre-wrap; }
  #empty { text-align: center; color: var(--faint); margin-top: 96px; font-size: 15px; }

  /* modals */
  .overlay {
    position: fixed; inset: 0; background: rgba(20,20,20,.45);
    display: none; align-items: flex-end; justify-content: center; z-index: 20;
  }
  .overlay.open { display: flex; }
  .sheet {
    background: var(--bg); width: 100%; max-width: 480px;
    border-radius: 18px 18px 0 0; padding: 28px 24px 44px;
    max-height: 92vh; overflow-y: auto;
  }
  .sheet h2 { font-size: 16px; font-weight: 600; margin-bottom: 22px; text-align: center; }
  .field { margin-bottom: 20px; }
  .field label { display: block; font-size: 13px; color: var(--faint); margin-bottom: 6px; }
  .field input[type=text], .field input[type=date], .field textarea {
    width: 100%; border: 1px solid #c9c9c5; background: #fff; border-radius: 8px;
    padding: 10px 12px; font: inherit; font-size: 15px;
  }
  .field textarea { min-height: 110px; resize: vertical; }
  .suggest-list {
    position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
    background: #fff; border: 1px solid #d8d8d3; border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.08); z-index: 5; overflow: hidden; display: none;
  }
  .suggest-list.show { display: block; }
  .suggest-list button {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 10px 12px; background: none; border: none; font: inherit; font-size: 13.5px;
    cursor: pointer; color: var(--ink); border-bottom: 1px solid #eee;
  }
  .suggest-list button:last-child { border-bottom: none; }
  .suggest-list button:hover { background: #f4f4f2; }
  .suggest-list .s-icon { color: var(--faint); flex: none; display: inline-flex; }
  .place a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
  .weather-row { display: flex; gap: 10px; }
  .weather-row button {
    flex: 1; padding: 10px 0; font: inherit; font-size: 15px; cursor: pointer;
    border: 1px solid #c9c9c5; background: #fff; border-radius: 8px;
    transition: border-color .15s ease, transform .1s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .weather-row button:hover { border-color: var(--ink); }
  .weather-row button.sel { border-color: var(--ink); background: var(--ink); color: #fff; }
  #photoDrop {
    border: 1px dashed #b5b5b0; border-radius: 8px; background: #fff;
    text-align: center; padding: 26px 12px; cursor: pointer; color: var(--faint); font-size: 14px;
    transition: border-color .15s ease, color .15s ease;
  }
  #photoDrop:hover { border-color: var(--ink); color: var(--ink); }
  #photoPreview { width: 100%; display: none; border: 1px solid var(--ink); cursor: pointer; transition: opacity .15s ease; }
  #photoPreview:hover { opacity: .85; }
  .btn-row { display: flex; gap: 12px; margin-top: 26px; }
  .btn {
    flex: 1; padding: 13px 0; font: inherit; font-size: 15px; cursor: pointer;
    border: 1px solid var(--ink); border-radius: 999px; background: none;
    transition: opacity .15s ease;
  }
  .btn:hover { opacity: .6; }
  .btn.primary { background: var(--ink); color: #fff; }
  .btn.primary:hover { opacity: .82; }
  .note { font-size: 12.5px; color: var(--faint); line-height: 1.6; }
  .note pre {
    background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 10px;
    font-size: 11px; overflow-x: auto; margin: 8px 0; user-select: all;
  }
  /* receipt print animation */
  #printOverlay {
    position: fixed; inset: 0; background: rgba(12,12,12,.82);
    display: none; flex-direction: column; align-items: center;
    padding-top: 7vh; z-index: 60;
  }
  #printOverlay.open { display: flex; }
  .printer-head {
    width: min(360px, 88vw); height: 34px; position: relative; z-index: 2;
    background: linear-gradient(#3a3a3a, #262626);
    border-radius: 10px; box-shadow: 0 6px 14px rgba(0,0,0,.5);
  }
  .printer-head::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px;
    height: 5px; background: #0c0c0c; border-radius: 3px;
  }
  .paper-mask {
    width: min(300px, 74vw); max-height: 62vh; overflow: hidden;
    margin-top: -8px; z-index: 1;
  }
  #printImg {
    width: 100%; display: block;
    transform: translateY(-101%);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,.45));
  }
  #printImg.printing { animation: feed 3s steps(70) forwards; }
  @keyframes feed {
    from { transform: translateY(-101%); }
    to   { transform: translateY(0); }
  }
  #printBar { margin-top: 26px; display: flex; gap: 14px; opacity: 0; transition: opacity .4s; }
  #printBar.show { opacity: 1; }
  #printBar .btn { background: var(--bg); min-width: 130px; }
  #printBar .btn.primary { background: var(--ink); border-color: #555; }
  #toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff; padding: 9px 20px; border-radius: 999px;
    font-size: 13.5px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50;
    white-space: nowrap;
  }
  #toast.show { opacity: 1; }
  /* entry menu popover */
  #popMenu {
    position: absolute; background: #fff; border: 1px solid #ccc; border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0,0,0,.12); display: none; z-index: 30; overflow: hidden;
  }
  #popMenu button { display: block; width: 100%; padding: 11px 26px; background: none; border: none; font: inherit; font-size: 14.5px; cursor: pointer; text-align: left; }
  #popMenu button:hover { background: #f0f0ee; }
  #popMenu button.danger { color: #c02020; }
