:root {
  --paper: #efd4ad;
  --paper-light: #f7e5c8;
  --paper-card: #f3ddbc;
  --ink: #4b3827;
  --muted: #806b54;
  --line: rgba(91, 65, 40, .27);
  --line-strong: rgba(79, 54, 31, .62);
  --shadow: rgba(83, 50, 22, .19);
  --green: #788d52;
  --dawn: #f4c77a;
  --meadow: #a8c69f;
  --summer: #f2d56b;
  --twilight: #cfa0b8;
  --bloom: #e7a7b8;
  --midnight: #49558f;
  --harvest: #b89068;
  --mist: #b9c3c7;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #d5a66d; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(255,255,255,.22), transparent 30%),
    linear-gradient(135deg, #d1a067, #e4bd88 48%, #cc955d);
  font-family: "Mali", cursive;
  font-weight: 400;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.paper-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}
.app-frame {
  width: min(100%, 1100px); min-height: 100vh; margin: 0 auto; background: var(--paper);
  box-shadow: 0 0 45px rgba(60,35,16,.28); position: relative; overflow-x: clip;
}
.topbar {
  height: 88px; padding: 10px 22px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 91%, transparent); backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.brand { border: 0; background: none; display: grid; justify-items: center; padding: 0; }
.brand-logo { display: block; width: 48px; height: 58px; object-fit: contain; }
.drawer-logo { display: block; width: 64px; height: 80px; object-fit: contain; flex: 0 0 auto; }
.icon-btn, .language-pill { border: 0; background: transparent; width: 44px; min-width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 27px; }
.menu-trigger { justify-self: start; align-self: center; }
.icon-btn:hover, .language-pill:hover { background: rgba(255,255,255,.24); }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 4px; }
.language-pill { min-width: 45px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line); }
.drawer { position: fixed; inset: 0 auto 0 max(0px, calc((100vw - 1100px)/2)); width: min(330px, 86vw); background: var(--paper-light); z-index: 40; padding: 34px 22px; transform: translateX(-105%); transition: .28s ease; box-shadow: 15px 0 35px rgba(64,39,18,.22); }
body.drawer-open .drawer { transform: translateX(0); }
.drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(61,40,23,.3); opacity: 0; pointer-events: none; transition: .25s; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; gap: 14px; align-items: center; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.drawer-head strong { display: block; font-family: "Mali", cursive; font-size: 25px; font-weight: 500; }
.drawer-head small { display: block; color: var(--muted); margin-top: 2px; }
.drawer-nav { display: grid; gap: 7px; margin-top: 22px; }
.drawer-nav button { display: flex; gap: 14px; align-items: center; border: 0; background: transparent; border-radius: 12px; padding: 13px 15px; text-align: left; }
.drawer-nav button:hover, .drawer-nav button.active { background: rgba(183,143,97,.19); }
.drawer-nav button span:first-child { width: 25px; text-align: center; font-size: 20px; }
.drawer-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 30px 14px 0; }
.drawer-nav .contact-route { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-legal { display: flex; gap: 8px; margin: 14px; color: var(--muted); font-size: 11px; }
#view { padding: 28px 32px calc(110px + var(--safe-bottom)); min-height: calc(100vh - 88px); outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 auto 24px; max-width: 980px; }
.page-head h1 { font-family: "Mali", cursive; font-size: clamp(27px, 4vw, 40px); font-weight: 500; margin: 0; letter-spacing: .03em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.eyebrow { letter-spacing: .16em; font-size: 10px !important; color: var(--muted); margin: 0 0 5px !important; }
.paper-panel { max-width: 980px; margin: 0 auto; background: rgba(249,231,202,.53); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 7px 18px var(--shadow); overflow: hidden; }
.calendar-toolbar { padding: 18px 20px 12px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.calendar-toolbar button { border: 0; background: transparent; font-size: 24px; }
.month-summary { color: var(--muted); font-size: 11px; margin-top: 4px; font-weight: 400; }
.today-button { display: block; margin: -7px auto 10px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.18); padding: 4px 12px; font-size: 10px; }
.month-title { font-family: "Mali", cursive; font-size: 22px; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays { padding: 0 8px; color: var(--muted); font-family: "Mali", cursive; font-size: 12px; text-align: center; }
.weekdays span { padding: 9px 2px; }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day { min-height: 95px; padding: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; position: relative; }
.calendar-day:hover { background: rgba(255,255,255,.18); }
.calendar-day.outside { opacity: .37; }
.calendar-day.selected { box-shadow: inset 0 0 0 2px #a77a3d; border-radius: 8px; background: rgba(255,238,202,.34); }
.day-number { display: block; text-align: center; font-family: "Mali", cursive; font-size: 15px; }
.photo-mini { display: block; width: 21px; height: 20px; margin: 5px auto 3px; border: 1px solid #826c50; border-radius: 2px; background: linear-gradient(#9bc6d4 0 44%, #f4cc78 45% 54%, #829d67 55%); box-shadow: 1px 1px 0 rgba(75,53,33,.25); }
.dots { min-height: 20px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-content: start; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(70,50,30,.12); }
.dot.more { width: auto; height: auto; border: 0; font-size: 9px; color: var(--muted); }
.day-detail { padding: 20px; border-top: 1px solid var(--line); }
.day-detail-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; }
.day-detail h2 { font-family: "Mali", cursive; font-weight: 500; font-size: 21px; margin: 0; }
.day-detail-head small { color: var(--muted); }
.timeline-entry { display: grid; grid-template-columns: 54px 12px 1fr 60px; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid rgba(93,65,38,.15); }
.timeline-entry time { font-family: "Mali", cursive; font-size: 12px; }
.timeline-entry p { margin: 0; font-size: 13px; line-height: 1.55; }
.timeline-entry small, .journal-content small { color: var(--muted); font-size: 10px; }
.entry-image { width: 55px; height: 43px; object-fit: cover; border: 3px solid #f7e5c7; outline: 1px solid #987858; border-radius: 2px; }
.mini-actions, .card-actions { display: flex; gap: 10px; margin-top: 7px; }
.mini-actions button, .card-actions button, .text-link { border: 0; border-bottom: 1px solid var(--line); padding: 2px 0; background: transparent; color: var(--muted); font-size: 10px; }
.text-link { display: block; margin: 12px auto 0; font-size: 12px; }
.inline-loader, .empty-inline { color: var(--muted); text-align: center; padding: 23px 10px; font-size: 12px; }
.entry-thumb { width: 55px; height: 43px; border: 3px solid #f7e5c7; outline: 1px solid #987858; border-radius: 2px; background: var(--scene, linear-gradient(#9bc9da 0 45%,#e9c775 46% 55%,#7e9d68 56%)); }
.journal-list { max-width: 760px; margin: 0 auto; display: grid; gap: 13px; }
.journal-card { display: grid; grid-template-columns: 7px 1fr auto; background: rgba(249,231,202,.67); border: 1px solid var(--line); box-shadow: 0 4px 10px var(--shadow); border-radius: 9px; overflow: hidden; }
.journal-strip { background: var(--entry-color); }
.journal-content { padding: 15px 17px; }
.journal-meta { display: flex; justify-content: space-between; color: var(--muted); font-family: "Mali", cursive; font-size: 11px; }
.journal-content p { margin: 10px 0 0; line-height: 1.7; }
.more-btn { border: 0; background: transparent; padding: 12px; align-self: start; font-size: 20px; }
.gallery-layout { max-width: 900px; margin: 0 auto; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.photo-tile { border: 0; padding: 6px; background: rgba(255,238,210,.68); box-shadow: 0 3px 8px var(--shadow); transform: rotate(var(--tilt,0deg)); }
.photo-tile.active { outline: 2px solid #a77a3d; outline-offset: 2px; }
.photo-art { display: block; aspect-ratio: 1; width: 100%; object-fit: cover; background: #d8c2a0; filter: saturate(.78) sepia(.08); }
.shared-badge { display: block; margin-top: 4px; color: var(--green); font-size: 9px; }
.selected-photo { margin-top: 20px; padding: 17px; display: grid; grid-template-columns: 150px 1fr; gap: 20px; border: 1px solid var(--line); background: rgba(248,229,199,.65); border-radius: 12px; }
.selected-photo .photo-art { border: 6px solid #f6e4c8; outline: 1px solid var(--line); }
.selected-photo h2 { font-family: "Mali", cursive; font-weight: 500; margin: 0; }
.selected-photo p { line-height: 1.6; }
.photo-meta { color: var(--muted); font-size: 12px; }
.action-row { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
.paper-button { border: 1px solid #a88d6c; border-radius: 14px; padding: 10px 16px; background: var(--paper-light); box-shadow: 0 2px 0 rgba(78,51,28,.12); }
.paper-button.primary { background: #83965c; color: #fff8e8; border-color: #6f7f4b; }
.paper-button.danger { background: #dfb6a8; color: #733d34; }
.paper-button:active { transform: translateY(1px); box-shadow: none; }
.daily-scroll { max-width: 980px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 12px; overflow-x: auto; padding: 5px 4px 20px; scroll-snap-type: x mandatory; }
.daily-card { scroll-snap-align: start; background: rgba(249,231,202,.68); border: 1px solid var(--line); border-radius: 6px; padding: 9px; box-shadow: 0 4px 12px var(--shadow); }
.daily-card .photo-art { aspect-ratio: 4/5; }
.daily-card blockquote { font-family: "Mali", cursive; text-align: center; min-height: 66px; margin: 13px 3px; line-height: 1.55; }
.meaning-actions { min-height: 47px; display: grid; place-items: center; margin: 4px 0 10px; }
.meaning-actions .paper-button { width: 100%; padding: 9px 10px; font-size: 11px; }
.meaning-actions span { color: var(--muted); font-size: 10px; }
.paper-button.meaningful-active { background: rgba(168,198,159,.46); border-color: #829b79; color: #4f6549; }
.daily-card footer { display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.daily-card footer button { margin-left: auto; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 9px; }
.dictionary { max-width: 900px; margin: 0 auto; }
.dictionary-mode + .dictionary-mode { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.dictionary-mode > header { margin-bottom: 13px; }
.dictionary-mode > header h2 { margin: 2px 0 5px; font-family: "Mali", cursive; font-weight: 500; }
.dictionary-mode > header p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }
.search-paper { display: flex; gap: 8px; background: rgba(255,239,215,.7); border: 1px solid var(--line); border-radius: 9px; padding: 6px; }
.search-paper input { width: 100%; border: 0; outline: 0; background: transparent; padding: 9px 12px; }
.search-paper button { border: 0; background: var(--green); color: white; border-radius: 7px; padding: 0 18px; }
.dictionary-grid { display: grid; grid-template-columns: minmax(210px,.72fr) 1.5fr; gap: 16px; margin-top: 15px; }
.evidence, .dictionary-results { border: 1px solid var(--line); background: rgba(249,231,202,.59); border-radius: 10px; }
.evidence { padding: 17px; }
.evidence h3 { margin-top: 0; font-family: "Mali", cursive; font-weight: 500; }
.stat { display: flex; justify-content: space-between; margin: 13px 0; font-size: 13px; }
.meter { height: 8px; border-radius: 8px; background: rgba(88,67,43,.14); overflow: hidden; }
.meter span { display: block; height: 100%; width: 72%; background: #8fa264; }
.dictionary-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; display: grid; grid-template-columns: 35px 1fr auto; text-align: left; gap: 11px; padding: 16px; align-items: center; }
.dictionary-row:last-child { border-bottom: 0; }
.dictionary-intro { margin-top: 18px; padding: 35px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.dictionary-results section { padding: 16px; border-bottom: 1px solid var(--line); }
.dictionary-results section:last-child { border-bottom: 0; }
.dictionary-results h3 { margin: 0 0 10px; font-weight: 500; }
.dictionary-results blockquote { margin: 9px 0; padding: 10px 12px; background: rgba(255,255,255,.18); border-left: 3px solid var(--harvest); }
.dictionary-results blockquote p { margin: 0; line-height: 1.6; }
.dictionary-results blockquote small { color: var(--muted); }
.dictionary-evidence { display: flex; gap: 12px; align-items: start; }
.dictionary-evidence img { width: 66px; height: 66px; flex: 0 0 auto; object-fit: cover; border: 3px solid var(--paper-light); outline: 1px solid var(--line); }
.dictionary-evidence div { min-width: 0; }
.ai-invitation { padding: 20px; border: 1px solid #87986b; border-radius: 12px; background: rgba(220,226,193,.42); }
.ai-invitation > header h2, .ai-invitation > header p { margin: 0; }
.ai-invitation > header h2 { font-family: "Mali", cursive; font-weight: 500; margin: 3px 0 6px; }
.ai-invitation > header p:last-child { color: var(--muted); font-size: 11px; line-height: 1.6; }
.ai-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 17px 0; }
.ai-guide section { padding: 14px; border: 1px solid rgba(88,67,43,.2); border-radius: 9px; background: rgba(255,248,231,.28); }
.ai-guide h3 { margin: 0 0 8px; font-size: 12px; }
.ai-guide ul { margin: 0; padding-left: 18px; }
.ai-guide li { margin: 7px 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.ai-request { display: grid; gap: 10px; }
.ai-question-row { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,239,215,.7); }
.ai-question-row input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; padding: 9px 12px; }
.ai-question-row button { flex: 0 0 auto; min-width: 185px; }
.ai-invitation label { display: flex; gap: 9px; align-items: start; color: var(--muted); font-size: 11px; }
.ai-invitation input, .consent-check input { accent-color: var(--green); }
.ai-invitation .ai-disable { margin-top: 13px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 10px; }
.ai-reflection { margin-top: 16px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(248,231,200,.76); box-shadow: 0 7px 22px var(--shadow); }
.ai-reflection > header { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ai-reflection > header h2 { margin: 2px 0 0; font-family: "Mali", cursive; font-weight: 500; }
.ai-reflection > header button { border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 10px; }
.ai-answer { font-size: 16px; line-height: 1.85; white-space: pre-line; }
.ai-reflection section { margin-top: 18px; }
.ai-reflection section h3 { font-size: 13px; margin: 0 0 8px; }
.ai-reflection li { margin: 7px 0; line-height: 1.6; }
.ai-insufficient { padding: 9px 12px; border-left: 3px solid var(--harvest); background: rgba(255,255,255,.25); }
.ai-sources { display: grid; gap: 8px; }
.ai-sources article { display: flex; gap: 10px; padding: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.2); }
.ai-sources img { width: 60px; height: 60px; object-fit: cover; flex: 0 0 auto; }
.ai-sources p { margin: 0; line-height: 1.55; }
.ai-sources small { color: var(--muted); }
.ai-reflection > footer { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }
.timeline-bar { display: grid; grid-template-columns: 65px 1fr 25px; gap: 8px; align-items: center; margin: 8px 0; font-size: 10px; }
.timeline-bar i { height: 7px; min-width: 3px; border-radius: 8px; background: var(--green); }
.contact-layout { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.75fr); gap: 18px; align-items: start; }
.contact-paper, .contact-history { border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(249,231,202,.62); box-shadow: 0 7px 18px var(--shadow); }
.contact-paper { padding: 22px; }
.contact-paper > header { display: flex; gap: 15px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.contact-paper > header img { width: 58px; height: 72px; object-fit: contain; flex: 0 0 auto; }
.contact-paper > header h2 { margin: 0 0 4px; font-family: "Mali", cursive; font-size: 19px; font-weight: 500; }
.contact-paper > header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.feedback-form { display: grid; gap: 14px; margin-top: 18px; }
.feedback-form > label { display: grid; gap: 6px; font-size: 12px; }
.feedback-form input, .feedback-form select, .feedback-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,248,231,.52); color: var(--ink); padding: 11px 12px; outline: none; }
.feedback-form textarea { resize: vertical; line-height: 1.6; }
.feedback-form input:focus, .feedback-form select:focus, .feedback-form textarea:focus { border-color: #8e724e; box-shadow: 0 0 0 2px rgba(142,114,78,.12); }
.feedback-file small { color: var(--muted); font-size: 9px; }
.feedback-consent { grid-template-columns: 18px 1fr !important; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.18); line-height: 1.5; }
.feedback-consent input { width: 16px; margin: 2px 0 0; accent-color: var(--green); }
.feedback-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.feedback-submit { width: 100%; min-height: 44px; }
.feedback-submit:disabled { opacity: .55; }
.contact-direct { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.contact-direct a { color: var(--ink); }
.feedback-receipt { margin-top: 18px; padding: 14px; display: flex; gap: 12px; align-items: center; border: 1px solid #87986b; border-radius: 11px; background: rgba(220,226,193,.42); }
.receipt-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff8e8; font-size: 19px; flex: 0 0 auto; }
.feedback-receipt h2, .feedback-receipt p { margin: 0; }
.feedback-receipt h2 { font-size: 14px; font-weight: 500; }
.feedback-receipt p { color: var(--muted); font-size: 9px; margin-top: 3px; }
.feedback-receipt strong { display: block; margin-top: 2px; letter-spacing: .06em; }
.contact-history { padding: 18px; }
.contact-history h2 { margin: 0 0 12px; font-family: "Mali", cursive; font-size: 18px; font-weight: 500; }
.feedback-ticket-list { display: grid; gap: 9px; }
.feedback-ticket-list article { padding: 11px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.17); }
.feedback-ticket-list strong, .feedback-ticket-list small { display: block; }
.feedback-ticket-list strong { font-size: 11px; letter-spacing: .04em; }
.feedback-ticket-list small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ticket-status { padding: 3px 7px; border-radius: 12px; background: rgba(184,144,104,.18); font-size: 8px; white-space: nowrap; }
.ticket-status.status-in_progress { background: rgba(244,199,122,.35); }
.ticket-status.status-replied { background: rgba(168,198,159,.4); }
.ticket-status.status-closed { background: rgba(185,195,199,.35); }
.state-panel { min-height: 300px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; }
.state-panel p { color: var(--muted); }
.state-symbol { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 24px; }
.state-panel.loading .state-symbol { animation: pulse 1.2s infinite alternate; }
@keyframes pulse { to { opacity: .35; transform: scale(.92); } }
.dictionary-row strong, .dictionary-row small { display: block; }
.dictionary-row small { color: var(--muted); margin-top: 2px; }
.bottom-nav { display: none; position: fixed; z-index: 19; bottom: 0; width: min(100%,1100px); grid-template-columns: repeat(5,1fr); background: color-mix(in srgb, var(--paper-light) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.bottom-nav button { border: 0; background: transparent; padding: 8px 2px 7px; display: grid; justify-items: center; gap: 1px; }
.bottom-nav button span { font-size: 20px; }
.bottom-nav button small { font-size: 9px; }
.bottom-nav button.active { color: #8d5f29; background: rgba(190,145,91,.15); }
.paper-dialog { width: min(520px, calc(100% - 30px)); border: 1px solid var(--line-strong); border-radius: 18px; background: var(--paper-light); box-shadow: 0 20px 50px rgba(61,36,18,.35); padding: 25px; }
.paper-dialog::backdrop { background: rgba(60,38,20,.35); backdrop-filter: blur(3px); }
.paper-dialog h2 { font-family: "Mali", cursive; font-weight: 500; margin-top: 4px; }
.paper-dialog textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: rgba(255,248,231,.52); border-radius: 10px; padding: 13px; outline: none; }
.dialog-close { float: right; border: 0; background: transparent; font-size: 24px; }
.palette { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 2px; }
.color-choice { width: 26px; height: 26px; border: 1px solid rgba(60,40,25,.18); border-radius: 50%; box-shadow: 0 0 0 3px transparent; }
.color-choice.selected { box-shadow: 0 0 0 3px var(--paper-light), 0 0 0 5px var(--ink); }
.no-color-choice { border: 1px solid var(--line); background: transparent; border-radius: 14px; padding: 3px 9px; font-size: 10px; }
.no-color-choice.selected { background: var(--ink); color: var(--paper-light); }
.confirm-dialog h2 { font-size: 19px; line-height: 1.6; margin-bottom: 22px; }
.privacy-dialog p, .privacy-dialog li { color: var(--muted); font-size: 12px; line-height: 1.7; }
.privacy-dialog ul { padding-left: 20px; }
.consent-check { display: flex; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.2); color: var(--ink); font-size: 12px; line-height: 1.55; }
.consent-check input { margin-top: 3px; flex: 0 0 auto; }
.privacy-links { display: flex; justify-content: center; gap: 10px; }
.meaning-preview { width: min(180px, 48vw); aspect-ratio: 1; display: block; margin: 8px auto 12px; object-fit: cover; border: 6px solid #f8e8cd; outline: 1px solid var(--line); border-radius: 4px; }
.meaning-caption { text-align: center; color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.meaning-dialog h2 { text-align: center; font-size: 20px; }
.meaning-dialog-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; margin-top: 5px; }
.anonymous-notice { max-width: 900px; margin: 0 auto 20px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #93a278; border-radius: 12px; background: rgba(219,226,191,.5); }
.anonymous-notice > div { display: flex; gap: 12px; align-items: center; }
.anonymous-notice img { width: 52px; height: 52px; object-fit: cover; border: 3px solid var(--paper-light); outline: 1px solid var(--line); }
.anonymous-notice p { margin: 0; line-height: 1.45; }
.anonymous-notice strong, .anonymous-notice small { display: block; }
.anonymous-notice small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.wide-button { width: 100%; margin-top: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(85px + var(--safe-bottom)); transform: translate(-50%,20px); z-index: 60; background: #4f3b29; color: #fff4df; padding: 10px 16px; border-radius: 20px; opacity: 0; pointer-events: none; transition: .25s; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 700px) {
  .topbar { height: 78px; padding: 8px 13px; }
  #view { padding: 20px 12px calc(90px + var(--safe-bottom)); min-height: calc(100vh - 78px); }
  .bottom-nav { display: grid; }
  .page-head { margin-bottom: 17px; padding: 0 5px; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 11px; }
  .paper-panel { border-radius: 13px; }
  .calendar-day { min-height: 65px; padding: 5px 2px; }
  .day-number { font-size: 12px; }
  .photo-mini { width: 16px; height: 15px; margin: 3px auto 2px; }
  .dot { width: 6px; height: 6px; }
  .dots { gap: 2px; min-height: 14px; }
  .timeline-entry { grid-template-columns: 42px 9px 1fr 44px; gap: 7px; }
  .timeline-entry p { font-size: 12px; }
  .entry-thumb { width: 41px; height: 33px; }
  .photo-grid { grid-template-columns: repeat(3,1fr); gap: 7px; }
  .selected-photo { grid-template-columns: 90px 1fr; gap: 13px; padding: 12px; }
  .selected-photo p { font-size: 12px; }
  .action-row .paper-button { flex: 1 1 40%; padding: 9px 7px; font-size: 12px; }
  .daily-scroll { grid-auto-columns: 72vw; }
  .anonymous-notice { align-items: stretch; }
  .anonymous-notice .paper-button { flex: 0 0 auto; padding: 8px 10px; font-size: 10px; }
  .meaning-dialog-actions { grid-template-columns: 1fr; }
  .dictionary-grid { grid-template-columns: 1fr; }
  .dictionary-results { order: -1; }
  .ai-guide { grid-template-columns: 1fr; }
  .ai-question-row { display: grid; }
  .ai-question-row button { width: 100%; min-width: 0; }
  .ai-reflection { padding: 16px; }
  .ai-reflection > header { display: block; }
  .ai-reflection > header button { margin-top: 9px; }
  .contact-layout { grid-template-columns: 1fr; }
  .contact-paper { padding: 16px; }
  .contact-history { order: 2; }
}

@media (max-width: 390px) {
  .calendar-day { min-height: 59px; }
  .calendar-grid, .weekdays { font-size: 10px; }
  .photo-grid { grid-template-columns: repeat(3,1fr); }
  .selected-photo { grid-template-columns: 1fr; }
  .selected-photo > .photo-art { max-width: 150px; }
}
