/* tripmate/diary/diary.css */
.tm-diary { padding: 16px; max-width: 720px; margin: 0 auto; }
.tm-diary[data-state="loading"] > * { opacity: 0; }
.tm-diary__library-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.tm-diary__library-header h1 { font-size: 24px; margin: 0; }
.tm-btn--primary {
  background: var(--tg-accent, #c47e3a); color: #fff;
  border: 0; padding: 12px 16px; border-radius: 8px;
  font-size: 17px; min-height: 48px; cursor: pointer;
}
#library-search {
  width: 100%; padding: 12px; font-size: 17px; min-height: 48px;
  border: 1px solid var(--tg-border, #d8cfbf); border-radius: 8px;
  background: var(--tg-surface, #fff); color: var(--tg-ink, #1a2638);
  margin-bottom: 12px;
}
.tm-diary__sort { display: flex; gap: 8px; margin-bottom: 16px; }
.tm-chip {
  padding: 10px 16px; min-height: 48px;
  border: 1px solid var(--tg-border, #d8cfbf); background: transparent;
  border-radius: 999px; font-size: 17px; cursor: pointer;
}
.tm-chip[aria-pressed="true"] {
  background: var(--tg-ink, #1a2638); color: #fff;
  border-color: var(--tg-ink, #1a2638);
}
.tm-diary__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.tm-diary__empty { color: var(--tg-muted, #6b6b6b); font-size: 17px; }
.tm-trip-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: 12px;
  background: var(--tg-surface, #fff); cursor: pointer;
  border: 1px solid var(--tg-border, #d8cfbf);
}
.tm-trip-row__thumb {
  width: 56px; height: 56px; border-radius: 8px;
  background: var(--tg-accent, #c47e3a); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600;
}
.tm-trip-row__body { flex: 1; min-width: 0; }
.tm-trip-row__name { font-size: 17px; font-weight: 600; }
.tm-trip-row__meta { font-size: 14px; color: var(--tg-muted, #6b6b6b); }
.tm-trip-row__menu {
  background: transparent; border: 0;
  width: 40px; height: 40px;
  font-size: 22px; cursor: pointer;
}
#row-menu {
  background: var(--tg-surface, #fff);
  border: 1px solid var(--tg-border, #d8cfbf);
  border-radius: 8px; padding: 4px;
  display: flex; flex-direction: column;
  z-index: 50; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#row-menu button {
  background: transparent; border: 0;
  padding: 10px 16px; font-size: 17px; min-height: 44px;
  text-align: left; cursor: pointer;
}
#row-menu button:hover { background: var(--tg-soft, #f5efe2); }

dialog#trip-create-dialog {
  border: 0; border-radius: 12px;
  padding: 20px; max-width: 480px; width: calc(100% - 32px);
  background: var(--tg-surface, #fff); color: var(--tg-ink, #1a2638);
}
dialog#trip-create-dialog::backdrop { background: rgba(26, 38, 56, 0.4); }
#trip-create-form { display: flex; flex-direction: column; gap: 12px; }
#trip-create-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
#trip-create-form input { font-size: 17px; padding: 10px; min-height: 48px; }
.tm-error { color: #b00020; font-size: 14px; margin: 0; }
.tm-dialog__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.tm-dialog__actions button { min-height: 48px; padding: 10px 16px; font-size: 17px; cursor: pointer; }
#tc-save { background: var(--tg-accent, #c47e3a); color: #fff; border: 0; border-radius: 8px; }
#tc-save:disabled { opacity: 0.5; cursor: not-allowed; }
#tc-cancel { background: transparent; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 8px; }

#durability-notice[hidden] { display: none; }
#durability-notice {
  position: fixed; inset: 0;
  background: rgba(26, 38, 56, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 100;
}
.tm-durability__panel {
  background: var(--tg-surface, #fff);
  padding: 24px; border-radius: 12px;
  max-width: 480px; width: 100%;
  display: flex; flex-direction: column; gap: 16px;
}
.tm-durability__panel h2 { margin: 0; font-size: 20px; }
.tm-durability__panel p { margin: 0; font-size: 17px; }

.tm-diary__countdown { padding: 32px 16px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tm-countdown__lede { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.1em; color: var(--tg-muted, #6b6b6b); }
.tm-countdown__numeral { font-family: 'DM Serif Display', serif; font-size: clamp(56px, 22vw, 88px); line-height: 1; color: var(--tg-ink, #102c44); }
.tm-countdown__name { font-family: 'DM Serif Display', serif; font-size: 24px; max-width: 280px; color: var(--tg-ink, #102c44); }
.tm-countdown__start { font-size: 14px; color: var(--tg-muted, #6b6b6b); }
.tm-countdown__strip-wrap { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 480px; margin-top: 12px; }
.tm-countdown__chev { width: 44px; height: 44px; min-width: 44px; border: 1px solid var(--tg-ink, #102c44); border-radius: 50%; background: var(--bg-elevated, #fff); font-size: 18px; cursor: pointer; }
.tm-countdown__chev:disabled { opacity: 0.3; cursor: not-allowed; }
.tm-countdown__pills { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tm-countdown__pills::-webkit-scrollbar { display: none; }
.tm-day-pill { flex-shrink: 0; padding: 12px 14px; min-width: 84px; min-height: 48px; background: var(--bg-elevated, #fff); border: 1px solid var(--tg-border, #d8cfbf); border-radius: 8px; cursor: pointer; text-align: center; }
.tm-day-pill .d { font-family: 'DM Serif Display', serif; font-size: 16px; }
.tm-day-pill .dt { font-size: 11px; color: var(--tg-muted, #6b6b6b); }
.tm-countdown__list-toggle { background: transparent; border: 0; color: var(--tg-accent, #c47e3a); font-size: 14px; cursor: pointer; padding: 8px; min-height: 44px; }
.tm-countdown__bypass { margin-top: 8px; }
.tm-countdown__pills.as-list { flex-direction: column; overflow-x: visible; gap: 4px; }
.tm-countdown__pills.as-list .tm-day-pill { width: 100%; min-width: 0; text-align: left; display: flex; gap: 12px; align-items: center; }
.tm-day-nav { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--tg-cream, #f5f0eb); border-bottom: 2px solid var(--tg-ink, #102c44); }
.tm-day-nav__chev { width: 44px; height: 44px; min-width: 44px; border: 1px solid var(--tg-ink, #102c44); background: var(--bg-elevated, #fff); border-radius: 50%; font-size: 18px; cursor: pointer; }
.tm-day-nav__chev:disabled { opacity: 0.3; cursor: not-allowed; }
.tm-day-nav__center { flex: 1; text-align: center; }
.tm-day-nav__label { font-family: 'DM Serif Display', serif; font-size: 18px; }
.tm-day-nav__share { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--tg-accent, #c47e3a); background: transparent; border-radius: 8px; color: var(--tg-accent, #c47e3a); cursor: pointer; }
.tm-day-nav__share-label { font-size: 13px; }
.tm-swipe-hint { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bg-surface, #fff8eb); border-bottom: 1px solid var(--tg-border, #d8cfbf); font-size: 14px; }
.tm-swipe-hint .dismiss { background: transparent; border: 0; font-size: 20px; min-width: 44px; min-height: 44px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .tm-day-nav__chev { transition: none; }
}
.tm-section-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.07em; color: var(--tg-muted, #6b6b6b); text-transform: uppercase; margin-bottom: 4px; }
.tm-stop-tile__btn { background: transparent; border: 0; font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--tg-ink, #102c44); padding: 8px 0; min-height: 44px; cursor: pointer; text-align: left; width: 100%; }
.tm-stop-tile__input { width: 100%; font-family: 'DM Serif Display', serif; font-size: 18px; padding: 8px; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 6px; min-height: 44px; }
.tm-stop-tile__saved { font-size: 12px; color: var(--tg-success, #5e7a3a); margin-top: 4px; }
.tm-details__toggle { width: 100%; padding: 12px 14px; min-height: 48px; border: 1px dashed var(--tg-border, #d8cfbf); background: transparent; border-radius: 12px; color: var(--tg-muted, #6b6b6b); font-size: 14px; cursor: pointer; text-align: left; }
.tm-details__panel { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.tm-details__panel[hidden] { display: none; }
.tm-details__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.tm-details__row input { flex: 1; padding: 10px; min-height: 44px; font-size: 16px; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 6px; }
.tm-mood { display: flex; gap: 4px; }
.tm-mood button { width: 36px; height: 44px; min-width: 36px; border: 1px solid var(--tg-border, #d8cfbf); background: var(--bg-elevated, #fff); border-radius: 6px; cursor: pointer; }
.tm-mood button.active { background: var(--tg-accent, #c47e3a); color: #fff; border-color: var(--tg-accent, #c47e3a); }
.tm-journal__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.tm-journal__state { font-size: 12px; }
.tm-journal__state[data-mode=saving] { color: var(--tg-accent, #c47e3a); }
.tm-journal__state[data-mode=saved] { color: var(--tg-success, #5e7a3a); }
.tm-journal__state[data-mode=error] { color: var(--tg-error, #a14040); cursor: pointer; }
.tm-journal__ta { width: 100%; min-height: 120px; font-family: 'EB Garamond', serif; font-size: 17px; line-height: 1.5; padding: 12px; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 8px; resize: vertical; background: var(--bg-input, #fff); color: var(--text-primary, #102c44); }
.tm-gallery__add-empty { width: 100%; padding: 24px; min-height: 96px; border: 1px dashed var(--tg-border, #d8cfbf); background: transparent; color: var(--tg-muted, #6b6b6b); border-radius: 8px; cursor: pointer; font-size: 15px; }
.tm-gallery__hero { width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--tg-soft, #ece5d9); }
.tm-gallery__hero img { width: 100%; height: 100%; object-fit: cover; }
.tm-gallery__strip { display: flex; gap: 4px; margin-top: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tm-gallery__strip::-webkit-scrollbar { display: none; }
.tm-gallery__thumb { flex-shrink: 0; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 4px; overflow: hidden; background: transparent; cursor: pointer; }
.tm-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-gallery__thumb--add { background: var(--bg-elevated, #fff); color: var(--tg-muted, #6b6b6b); font-size: 22px; display: flex; align-items: center; justify-content: center; }
.tm-gallery__overflow { flex-shrink: 0; min-width: 48px; min-height: 48px; padding: 0 10px; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 4px; background: var(--bg-elevated, #fff); cursor: pointer; font-size: 12px; }
.tm-weather__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tm-weather__line { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--tg-ink, #102c44); }
.tm-weather__refresh { background: transparent; border: 0; color: var(--tg-accent, #c47e3a); font-size: 13px; min-height: 44px; padding: 0 8px; cursor: pointer; }
.tm-weather__prompt { font-size: 14px; color: var(--tg-muted, #6b6b6b); }
.tm-weather__cta { margin-top: 6px; padding: 10px 14px; min-height: 44px; background: var(--tg-accent, #c47e3a); color: #fff; border: 0; border-radius: 8px; font-size: 14px; cursor: pointer; }
.tm-weather__error { font-size: 13px; color: var(--tg-error, #a14040); }

.tm-share-sheet { position: fixed; inset: 0; background: rgba(16,44,68,0.4); display: flex; align-items: flex-end; justify-content: center; z-index: 200; }
.tm-share-sheet[hidden] { display: none; }
.tm-share-sheet__panel { background: var(--tg-cream, #f5f0eb); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; max-height: 90vh; overflow-y: auto; }
.tm-share-sheet__panel h2 { font-family: 'DM Serif Display', serif; font-size: 20px; }
.tm-share-sheet__close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.tm-share__safety { background: #fff8eb; border-left: 3px solid var(--tg-accent, #c47e3a); padding: 10px 12px; font-size: 14px; }
#share-preview { width: 100%; max-height: 240px; object-fit: contain; border-radius: 8px; background: var(--bg-elevated, #fff); }
#share-caption { width: 100%; min-height: 80px; padding: 10px; font-size: 14px; border: 1px solid var(--tg-border, #d8cfbf); border-radius: 8px; }
.tm-share-sheet__actions { display: flex; flex-direction: column; gap: 8px; }
.tm-share-sheet__btn { padding: 12px; min-height: 48px; border: 1px solid var(--tg-border, #d8cfbf); background: var(--bg-elevated, #fff); border-radius: 8px; font-size: 15px; cursor: pointer; color: var(--text-primary, #102c44); }
.tm-share__primary { background: var(--tg-accent, #c47e3a); color: #fff; border-color: var(--tg-accent, #c47e3a); }

.tm-day-header { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.07em; color: var(--tg-muted, #6b6b6b); padding: 12px 16px 0; }
.tm-day-section { padding: 14px 16px; border-top: 2px solid var(--tg-ink, #102c44); }
.tm-day-section:first-of-type { border-top: 0; }
.tm-share-day { display: block; margin: 16px; padding: 14px; min-height: 48px; background: var(--tg-accent, #c47e3a); color: #fff; border: 0; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; width: calc(100% - 32px); }
.tm-bridge-link { display: block; text-align: center; margin: 8px 0 24px; font-size: 12px; color: var(--tg-muted, #6b6b6b); text-decoration: underline; }
.tm-demo-overlay { position: fixed; inset: 0; background: rgba(16,44,68,0.4); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
.tm-demo-overlay[hidden] { display: none; }
.tm-demo-overlay__sheet { background: var(--tg-cream, #f5f0eb); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.tm-demo-overlay__handle { width: 40px; height: 4px; background: var(--tg-border, #d8cfbf); border-radius: 2px; align-self: center; margin-bottom: 4px; }
.tm-demo-overlay h2 { font-family: 'DM Serif Display', serif; font-size: 24px; }
.tm-demo-overlay p { font-size: 17px; color: var(--tg-ink, #102c44); }
.tm-btn--ghost { background: transparent; border: 1px solid var(--tg-ink, #102c44); color: var(--tg-ink, #102c44); padding: 12px 16px; min-height: 48px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.tm-btn--text { background: transparent; border: 0; color: var(--tg-accent, #c47e3a); font-size: 14px; min-height: 44px; cursor: pointer; }
.tm-demo-chip { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--tg-ink, #102c44); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; cursor: pointer; z-index: 50; min-height: 44px; display: flex; align-items: center; }
.tm-demo-chip[hidden] { display: none; }
.tm-demo-pill { background: var(--tg-accent, #c47e3a); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; margin-left: 8px; }
.tm-detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.tm-journal__readonly { font-family: 'EB Garamond', serif; font-size: 17px; line-height: 1.5; }
.tm-ios-tip { position: fixed; bottom: 72px; left: 16px; right: 16px; max-width: 480px; margin: 0 auto; background: var(--tg-cream, #f5f0eb); border: 1px solid var(--tg-border, #d8cfbf); border-radius: 12px; padding: 16px; z-index: 60; box-shadow: 0 4px 16px rgba(16,44,68,0.15); display: flex; flex-direction: column; gap: 8px; }
.tm-ios-tip[hidden] { display: none; }
.tm-ios-tip strong { font-family: 'DM Serif Display', serif; font-size: 16px; }
.tm-ios-tip p { font-size: 14px; }
.tm-ios-tip__how summary { cursor: pointer; padding: 6px 0; font-size: 13px; color: var(--tg-accent, #c47e3a); min-height: 32px; }
.tm-ios-tip__how ol { padding-left: 18px; font-size: 13px; }
.tm-ios-tip [data-act=got-it] { align-self: flex-end; padding: 8px 14px; min-height: 40px; background: var(--tg-accent, #c47e3a); color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
