:root {
  --bg: #090814;
  --bg-soft: #121126;
  --panel: rgba(11, 16, 34, 0.88);
  --panel-strong: rgba(16, 20, 44, 0.96);
  --line: rgba(176, 109, 255, 0.28);
  --line-strong: rgba(73, 225, 255, 0.5);
  --text: #f7f4ff;
  --muted: #aca8be;
  --cyan: #49e1ff;
  --violet: #c86eff;
  --violet-strong: #9b4dff;
  --green: #7dff7a;
  --red: #ff6f91;
  --shadow: 0 0 24px rgba(155, 77, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(105, 58, 183, 0.26), transparent 26%),
    linear-gradient(180deg, #090814 0%, #05040c 100%);
  color: var(--text);
  font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
}

body {
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(109, 62, 189, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 225, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 4px);
  pointer-events: none;
  z-index: -1;
}

button, textarea, input, a {
  font: inherit;
}

button, a {
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(3, 4, 12, 0.88);
  backdrop-filter: blur(12px);
}

#login-screen[hidden] {
  display: none !important;
}

.login-card {
  width: min(360px, calc(100% - 24px));
  padding: 24px;
  border-radius: 24px;
  background: rgba(11, 16, 34, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-icon-notes {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(26, 23, 54, 0.98), rgba(10, 13, 28, 0.98));
  border: 1px solid rgba(73, 225, 255, 0.24);
  color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(200, 110, 255, 0.12), 0 0 26px rgba(73, 225, 255, 0.12);
}

.login-card h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card p {
  margin-top: 10px;
  color: var(--muted);
}

.login-button {
  width: 100%;
  margin-top: 18px;
}

.portal-page {
  display: none;
}

.show-portal {
  overflow: auto;
}

.show-portal .portal-page {
  display: flex;
}

.show-portal .app-shell {
  display: none;
}

.show-app .portal-page {
  display: none;
}

.portal-page {
  position: relative;
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 14px 32px;
  flex-direction: column;
  gap: 18px;
}

.portal-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.portal-top,
.portal-hero,
.portal-memori-card,
.portal-feature-list article,
.app-header,
.memori-strip,
.chat-form,
.kanban-column,
.vault-list,
.vault-editor,
.meal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
}

.portal-top-actions,
.header-actions,
.meal-actions,
.editor-actions,
.vault-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-brand,
h1,
.portal-hero h1 {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.55rem;
  color: var(--violet);
  text-shadow: 0 0 16px rgba(200, 110, 255, 0.8);
}

.portal-mark {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  color: var(--cyan);
}

.portal-brand-text {
  text-transform: none;
  letter-spacing: 0.04em;
}

.portal-mini-launch,
.ghost-button,
.calendar-link,
.quick-actions button,
.view-tabs button,
.view-tab-link,
.task-actions button,
.vault-item,
.meal-slot-picker button,
.primary-button,
.send-button,
.task-form button,
#saveVaultButton {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(33, 24, 66, 0.95), rgba(13, 16, 36, 0.96));
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.portal-mini-launch:hover,
.ghost-button:hover,
.calendar-link:hover,
.quick-actions button:hover,
.view-tabs button:hover,
.view-tab-link:hover,
.task-actions button:hover,
.vault-item:hover,
.meal-slot-picker button:hover,
.primary-button:hover,
.send-button:hover,
.task-form button:hover,
#saveVaultButton:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 0 14px rgba(73, 225, 255, 0.22);
}

.portal-hero {
  padding: 22px 18px 26px;
  border-radius: 28px;
  text-align: center;
}

.portal-kicker,
.eyebrow,
.meal-eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 6px 0 0;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.portal-copy {
  margin: 12px auto 0;
  max-width: 500px;
  color: #dbd6f4;
  line-height: 1.6;
}

.portal-photo-main {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  margin: 18px auto 0;
  padding: 6px;
  border-radius: 50%;
  border: 2px solid rgba(200, 110, 255, 0.84);
  box-shadow: 0 0 24px rgba(200, 110, 255, 0.78), 0 0 38px rgba(73, 225, 255, 0.16);
  background: rgba(9, 11, 24, 0.94);
}

.portal-photo-main img,
.portal-gallery img,
.memori-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-photo-main img {
  border-radius: 50%;
}

.portal-memori-card {
  padding: 16px;
  border-radius: 24px;
}

.portal-guide-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 18, 41, 0.96), rgba(10, 12, 28, 0.98));
  border: 1px solid rgba(73, 225, 255, 0.22);
  box-shadow: var(--shadow);
}

.portal-guide-head h2 {
  margin: 4px 0 0;
  font-size: 1.08rem;
  letter-spacing: 0.04em;
}

.portal-guide-steps {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.portal-guide-steps article {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 23, 49, 0.9);
  border: 1px solid rgba(200, 110, 255, 0.18);
}

.portal-guide-steps strong,
.portal-guide-steps span {
  display: block;
}

.portal-guide-steps strong {
  color: #f4de8f;
  font-size: 0.9rem;
}

.portal-guide-steps span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.portal-message {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(21, 24, 41, 0.9);
}

.portal-message h2,
.meal-header h2,
.kanban-column h2,
h1,
p {
  margin: 0;
}

.portal-message p {
  margin-top: 10px;
  line-height: 1.65;
  color: #f2eeff;
}

.portal-message span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.portal-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.portal-gallery button {
  padding: 4px;
  height: 94px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(11, 16, 34, 0.94);
}

.portal-gallery button.active {
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(73, 225, 255, 0.38);
}

.portal-gallery img {
  border-radius: 14px;
}

.portal-launch {
  min-height: 84px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #b85cff 0%, #7c5bff 48%, #35d7ff 100%);
  color: white;
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  font-weight: 800;
  box-shadow: 0 0 24px rgba(123, 84, 255, 0.45);
}

.portal-feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.portal-feature-list article {
  padding: 16px;
  border-radius: 20px;
}

.portal-feature-list strong {
  display: block;
  font-size: 1rem;
}

.portal-feature-list span {
  display: block;
  margin-top: 8px;
  color: #d7d0ee;
  line-height: 1.55;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 16px;
}

.app-header h1 {
  margin-top: 2px;
  font-size: 1.2rem;
}

.ghost-button,
.calendar-link,
.portal-mini-launch {
  padding: 4px 8px;
  font-size: 0.78rem;
}

.memori-strip {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 24px;
}

.memori-avatar-wrap {
  width: 144px;
  height: 144px;
  padding: 3px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 18px rgba(73, 225, 255, 0.2);
}

.memori-avatar {
  border-radius: 20px;
}

.memori-status {
  display: grid;
  gap: 10px;
}

.memori-status p {
  color: #e8e3ff;
  line-height: 1.55;
}

.quick-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-view="mealView"] .quick-actions {
  display: none;
}

.quick-actions::-webkit-scrollbar,
.talk-quick-row::-webkit-scrollbar {
  display: none;
}

.quick-actions button,
.talk-quick-row button,
.view-tabs button,
.view-tab-link,
.task-form button,
.meal-slot-picker button,
.primary-button,
.send-button {
  padding: 7px 10px;
  white-space: nowrap;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 6;
}

.view-tabs > button,
.view-tabs > .view-tab-link {
  display: flex;
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.view-tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  text-decoration: none;
}

.talk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.talk-panel-title {
  color: var(--violet);
  font-size: 1.05rem;
  font-weight: 800;
}

.talk-panel-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.talk-mini-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: 0.72rem;
  text-decoration: underline;
}

.talk-quick-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 2px 2px 0;
}

.talk-quick-row button {
  flex: 1;
  min-width: 0;
  max-width: 180px;
  border: 1px solid rgba(176, 109, 255, 0.34);
  background: linear-gradient(180deg, rgba(38, 27, 69, 0.96), rgba(17, 18, 42, 0.98));
  color: #e8ddff;
  box-shadow: inset 0 0 12px rgba(155, 77, 255, 0.08);
}

.talk-quick-row button:nth-child(2) {
  border-color: rgba(73, 225, 255, 0.34);
  color: #bcefff;
}

.talk-quick-row button:nth-child(3) {
  border-color: rgba(255, 206, 112, 0.3);
  color: #ffe2a6;
}

.talk-quick-row button:nth-child(4) {
  border-color: rgba(214, 104, 255, 0.34);
  color: #edc4ff;
}

.quick-choice-panel {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(73, 225, 255, 0.24);
  border-radius: 8px;
  background: rgba(13, 14, 33, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.quick-choice-panel[hidden] {
  display: none;
}

.quick-choice-title {
  color: #d9f8ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.quick-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.quick-choice-panel[data-mode="event"] .quick-choice-options {
  grid-template-columns: 1fr;
}

.quick-choice-option {
  appearance: none;
  display: grid;
  min-height: 46px;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(176, 109, 255, 0.36);
  border-radius: 8px;
  background: rgba(34, 25, 63, 0.92);
  color: #f1eaff;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.quick-choice-option:active {
  border-color: rgba(73, 225, 255, 0.7);
  background: rgba(35, 65, 91, 0.92);
}

.quick-choice-label {
  color: #f8f2ff;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
}

.quick-choice-note {
  color: rgba(217, 248, 255, 0.76);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.talk-view-shortcuts {
  display: flex;
  gap: 6px;
  padding: 2px 4px;
  justify-content: center;
}

.talk-view-shortcuts button {
  flex: 1;
  padding: 4px 0;
  font-size: 0.7rem;
  border: 1px solid rgba(73, 225, 255, 0.2);
  border-radius: 10px;
  background: rgba(29, 32, 55, 0.7);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, color 0.2s;
}

.talk-view-shortcuts button:active {
  background: linear-gradient(135deg, rgba(52, 177, 255, 0.3), rgba(177, 78, 255, 0.3));
  color: #fff;
}

.quick-note-launch-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 2px 4px;
}

.quick-note-launch {
  width: 100%;
  padding: 5px 10px;
  border: 1px dashed rgba(176, 109, 255, 0.46);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(39, 28, 69, 0.82), rgba(18, 20, 45, 0.9));
  color: #dfceff;
  font-size: 0.76rem;
}

.quick-note-launch-row .quick-note-launch {
  width: auto;
  min-width: 0;
  flex: 1;
}

.link-shelf-launch {
  border-style: solid;
  border-color: rgba(73, 225, 255, 0.34);
  color: #bcefff;
}

.quick-note-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: rgba(73, 225, 255, 0.16);
  color: #bcefff;
  font-size: 0.68rem;
}

.quick-note-count[hidden] {
  display: none;
}

.catch-launch {
  border-color: rgba(73, 225, 255, 0.45);
  background: rgba(73, 225, 255, 0.08);
  color: var(--cyan);
}

.catch-workspace[hidden],
.catch-card[hidden],
.catch-preview-image[hidden] {
  display: none;
}

.catch-workspace {
  max-height: min(34dvh, 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.catch-card {
  display: flex;
  gap: 10px;
  margin: 1px 4px;
  padding: 10px;
  border: 1px solid rgba(73, 225, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 31, 56, 0.98), rgba(28, 18, 53, 0.98));
  box-shadow: 0 0 18px rgba(73, 225, 255, 0.09);
}

.catch-preview-image {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(73, 225, 255, 0.24);
  border-radius: 11px;
}

.catch-card-body {
  min-width: 0;
  flex: 1;
}

.catch-eyebrow {
  margin: 0 0 2px;
  color: var(--cyan);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catch-card h2 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}

.catch-card-text,
.catch-reason,
.catch-privacy-note,
.catch-status {
  margin: 3px 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.catch-card-text {
  color: var(--text);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.catch-reason,
.catch-privacy-note {
  color: var(--muted);
  font-size: 0.68rem;
}

.catch-status {
  min-height: 1em;
  color: #ffe2a6;
  font-size: 0.7rem;
}

.catch-actions,
.catch-route-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.catch-actions button,
.catch-route-buttons button {
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid rgba(73, 225, 255, 0.24);
  border-radius: 9px;
  background: rgba(73, 225, 255, 0.07);
  color: var(--cyan);
  font-size: 0.7rem;
}

.catch-actions .catch-primary,
.catch-route-buttons .is-recommended {
  border-color: rgba(255, 206, 112, 0.5);
  background: linear-gradient(135deg, rgba(184, 92, 255, 0.48), rgba(53, 215, 255, 0.34));
  color: #fff;
  font-weight: 800;
}

.catch-actions button:disabled,
.catch-route-buttons button:disabled {
  opacity: 0.48;
}

.quick-note-sheet[hidden] {
  display: none;
}

.quick-note-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  align-items: end;
}

.quick-note-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 10, 0.72);
  backdrop-filter: blur(3px);
}

.quick-note-panel {
  position: relative;
  width: min(100%, 680px);
  max-height: min(82dvh, 720px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 15px;
  padding-bottom: calc(15px + env(safe-area-inset-bottom));
  overflow: hidden;
  border: 1px solid rgba(176, 109, 255, 0.4);
  border-radius: 22px 22px 0 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(94, 55, 164, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(18, 20, 45, 0.995), rgba(7, 9, 24, 0.995));
  box-shadow: 0 -12px 44px rgba(47, 23, 91, 0.38);
}

.quick-note-head,
.quick-note-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-note-head h2 {
  margin: 0;
  color: #e8ddff;
  font-size: 1.1rem;
}

.quick-note-head p,
.quick-note-status,
.quick-note-empty {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.quick-note-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.35rem;
}

.quick-state-groups {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  flex: 0 0 auto;
}

.quick-state-group {
  display: grid;
  grid-template-columns: 48px repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 5px;
}

.quick-state-group > span {
  color: #d8c9ff;
  font-size: 0.72rem;
  font-weight: 700;
}

.quick-state-group button {
  min-width: 0;
  padding: 7px 3px;
  border: 1px solid rgba(176, 109, 255, 0.24);
  border-radius: 999px;
  background: rgba(39, 31, 72, 0.72);
  color: var(--text);
  font-size: 0.7rem;
}

.quick-note-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 12px;
  flex: 0 0 auto;
}

.quick-note-form textarea {
  min-height: 42px;
  max-height: 100px;
  padding: 9px;
  border-color: rgba(176, 109, 255, 0.32);
}

.quick-note-mic,
.quick-note-save,
.quick-note-cancel {
  border: 0;
  border-radius: 12px;
  padding: 0 10px;
}

.quick-note-mic {
  border: 1px solid rgba(176, 109, 255, 0.3);
  background: linear-gradient(180deg, rgba(57, 40, 91, 0.95), rgba(27, 25, 59, 0.98));
  color: #e8ddff;
}

.quick-note-save {
  background: linear-gradient(135deg, rgba(155, 77, 255, 0.95), rgba(73, 225, 255, 0.92));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(73, 225, 255, 0.16);
}

.quick-note-cancel {
  grid-column: 2 / -1;
  min-height: 32px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.quick-note-cancel[hidden] {
  display: none;
}

.quick-note-status {
  min-height: 1.2em;
  color: #bcefff;
  flex: 0 0 auto;
}

.quick-note-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-color: rgba(176, 109, 255, 0.52) rgba(11, 13, 31, 0.8);
  scrollbar-width: thin;
}

.quick-note-list::-webkit-scrollbar {
  width: 5px;
}

.quick-note-list::-webkit-scrollbar-track {
  background: rgba(11, 13, 31, 0.8);
}

.quick-note-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(176, 109, 255, 0.58), rgba(73, 225, 255, 0.44));
}

.quick-note-item {
  padding: 10px;
  border: 1px solid rgba(176, 109, 255, 0.22);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(31, 27, 59, 0.9), rgba(17, 21, 43, 0.92));
}

.quick-note-item > p {
  margin: 0 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.quick-note-item time {
  color: var(--muted);
  font-size: 0.68rem;
}

.quick-note-destinations {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 9px;
}

.quick-note-destinations > span {
  grid-column: 1 / -1;
  color: #cfc3ff;
  font-size: 0.68rem;
  font-weight: 700;
}

.quick-note-destinations button {
  min-width: 0;
  padding: 6px 3px;
  border: 1px solid rgba(73, 225, 255, 0.24);
  border-radius: 9px;
  background: rgba(73, 225, 255, 0.08);
  color: var(--cyan);
  font-size: 0.68rem;
}

.quick-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quick-note-actions button {
  padding: 5px 8px;
  border: 1px solid rgba(73, 225, 255, 0.22);
  border-radius: 9px;
  background: rgba(73, 225, 255, 0.08);
  color: var(--cyan);
  font-size: 0.68rem;
}

.quick-note-actions .quick-note-delete {
  border-color: rgba(255, 111, 145, 0.18);
  background: rgba(255, 111, 145, 0.08);
  color: #ff9eb4;
}

.quick-note-actions .quick-note-edit {
  border-color: rgba(176, 109, 255, 0.26);
  background: rgba(176, 109, 255, 0.09);
  color: #dfceff;
}

.task-form-status {
  min-height: 1.3em;
  margin: 4px 0 8px;
  color: #ffe2a6;
  font-size: 0.76rem;
}

.task-transfer-cancel {
  margin: 0 0 8px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 206, 112, 0.24);
  border-radius: 9px;
  background: rgba(255, 206, 112, 0.07);
  color: #ffe2a6;
  font-size: 0.72rem;
}

.task-transfer-cancel[hidden] {
  display: none;
}

.mic-button.is-listening,
.quick-note-mic.is-listening {
  background: rgba(255, 111, 145, 0.18);
  color: #ffd2dc;
  box-shadow: 0 0 14px rgba(255, 111, 145, 0.2);
}

body.quick-note-open {
  overflow: hidden;
}

body.link-shelf-open {
  overflow: hidden;
}

.link-shelf-panel {
  max-height: min(78dvh, 680px);
}

.link-search-input {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(73, 225, 255, 0.3);
  border-radius: 12px;
  background: rgba(6, 8, 22, 0.88);
  color: var(--text);
}

.link-search-input::placeholder {
  color: var(--muted);
}

.link-shelf-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.link-shelf-mini-button,
.link-folder-chip,
.link-shelf-action {
  border: 1px solid rgba(73, 225, 255, 0.24);
  border-radius: 10px;
  background: rgba(15, 22, 42, 0.82);
  color: #8fe9ff;
}

.link-shelf-mini-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.link-folder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.link-folder-chip {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.72rem;
}

.link-folder-chip.active {
  border-color: rgba(255, 210, 96, 0.5);
  background: rgba(255, 210, 96, 0.14);
  color: #ffd978;
}

.link-shelf-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(73, 225, 255, 0.22);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(23, 29, 59, 0.94), rgba(18, 20, 43, 0.94));
}

.link-shelf-folder-title {
  margin: 12px 2px 6px;
  color: #ffd978;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.link-shelf-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.link-shelf-open-link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.link-shelf-open-link strong,
.link-shelf-open-link span,
.link-shelf-open-link time {
  display: block;
}

.link-shelf-open-link strong {
  overflow: hidden;
  color: #e8ddff;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-shelf-open-link span {
  margin-top: 4px;
  overflow: hidden;
  color: #9ee9fa;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-shelf-open-link time {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.66rem;
}

.link-shelf-folder-label {
  display: inline-flex;
  margin-top: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 210, 96, 0.12);
  color: #ffd978;
  font-size: 0.67rem;
}

.link-shelf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.link-shelf-action {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.7rem;
}

.link-shelf-action.link-shelf-memory {
  color: #8ff5cb;
  border-color: rgba(85, 240, 180, 0.24);
}

.link-shelf-action.link-shelf-qr {
  border-color: rgba(177, 78, 255, 0.42);
  background: rgba(177, 78, 255, 0.14);
  color: #e3c4ff;
  font-weight: 700;
}

.link-shelf-action.link-shelf-danger {
  color: #ff9eb4;
  border-color: rgba(255, 111, 145, 0.2);
  background: rgba(255, 111, 145, 0.08);
}

.link-shelf-inline-qr {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-items: center;
  padding: 0;
  text-align: center;
}

.link-shelf-inline-qr-code {
  display: grid;
  width: 128px;
  min-height: 128px;
  padding: 6px;
  place-items: center;
  border-radius: 10px;
  background: #ffffff;
  color: #251c3a;
  font-size: 0.76rem;
}

.link-shelf-inline-qr-code img,
.link-shelf-inline-qr-code canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.view-tabs button.active,
.meal-slot-picker button.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(52, 177, 255, 0.2), rgba(177, 78, 255, 0.2));
  box-shadow: 0 0 16px rgba(73, 225, 255, 0.2);
}

main,
.view.active {
  min-height: 0;
}

main {
  min-height: 0;
  position: relative;
  z-index: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#talkView.active {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  gap: 4px;
}

.talk-log {
  min-height: 0;
  padding: 10px 10px 18px;
  border-radius: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 92%;
}

.message-content {
  display: grid;
  gap: 3px;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(73, 225, 255, 0.45);
  background: rgba(8, 10, 22, 0.92);
}

.bubble {
  padding: 9px 12px;
  border-radius: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.memori .bubble {
  background: rgba(29, 32, 55, 0.95);
  border: 1px solid rgba(200, 110, 255, 0.18);
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: linear-gradient(135deg, rgba(22, 205, 156, 0.86), rgba(20, 161, 140, 0.92));
  color: #081314;
  border: 1px solid rgba(73, 225, 255, 0.14);
  border-bottom-right-radius: 4px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
}

.message.user .message-meta {
  justify-content: flex-end;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.message-favorite {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.88rem;
  line-height: 1;
  transition: color 0.3s, transform 0.2s;
}

.message-favorite.is-active {
  color: #ff4081;
  animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-form {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: var(--panel);
  position: relative;
  z-index: 1;
}

.task-form textarea {
  grid-column: 1 / -1;
  min-height: 48px;
}

textarea,
input[type="text"],
input[type="datetime-local"] {
  width: 100%;
  border: 1px solid rgba(200, 110, 255, 0.18);
  border-radius: 14px;
  background: rgba(6, 8, 20, 0.92);
  color: var(--text);
  padding: 9px 11px;
  resize: none;
  outline: none;
}

textarea:focus,
input[type="text"]:focus,
input[type="datetime-local"]:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(73, 225, 255, 0.24);
}

.mic-button {
  width: 48px;
  border: 1px solid rgba(176, 109, 255, 0.42);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(58, 39, 92, 0.98), rgba(26, 24, 57, 0.98));
  color: #e9ddff;
  box-shadow: inset 0 0 12px rgba(200, 110, 255, 0.1);
  font-size: 0.8rem;
}

.catch-photo-button {
  width: 42px;
  min-width: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(73, 225, 255, 0.28);
  border-radius: 12px;
  background: rgba(73, 225, 255, 0.08);
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.send-button,
.primary-button,
.task-form button,
#saveVaultButton {
  background: linear-gradient(135deg, rgba(184, 92, 255, 0.85), rgba(53, 215, 255, 0.85));
  color: #fff;
  border: 0;
}

.vault-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.kanban-column {
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
}

.kanban-column:nth-child(1) {
  background: linear-gradient(180deg, rgba(38, 27, 76, 0.94), rgba(17, 21, 40, 0.92));
}

.kanban-column:nth-child(2) {
  background: linear-gradient(180deg, rgba(16, 46, 72, 0.94), rgba(17, 21, 40, 0.92));
}

.kanban-column:nth-child(3) {
  background: linear-gradient(180deg, rgba(18, 60, 48, 0.94), rgba(17, 21, 40, 0.92));
}

.kanban-column h2 {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card,
.meal-summary-card,
.meal-log-card {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(200, 110, 255, 0.16);
  background: rgba(17, 21, 40, 0.92);
}

.task-card {
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.task-card::before {
  content: "↓ 次へ　↑ 戻す";
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.task-card.is-swipe-ready {
  transform: translateY(5px);
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(73, 225, 255, 0.18);
}

.task-card.is-press-armed {
  border-color: var(--line-strong);
  box-shadow: 0 0 12px rgba(73, 225, 255, 0.14);
}

.task-card p,
.meal-log-card p {
  margin-top: 8px;
  line-height: 1.55;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.task-actions button,
.vault-item {
  padding: 7px 10px;
}

.countdown {
  display: inline-block;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 700;
}

.countdown.is-over {
  color: #ff9800;
}

.meal-panel {
  padding: 16px;
  border-radius: 24px;
}

.meal-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.meal-help {
  max-width: 320px;
  color: var(--muted);
  line-height: 1.5;
}

.meal-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.meal-photo-field {
  min-height: 44px;
  padding: 4px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: rgba(7, 11, 26, 0.82);
}

.meal-photo-input {
  width: 100%;
  min-height: 36px;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
}

.meal-photo-input::file-selector-button {
  min-height: 36px;
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--cyan);
  background: rgba(24, 35, 63, 0.95);
  font: inherit;
}

.meal-photo-input:disabled {
  opacity: 0.65;
}

.meal-photo-status {
  min-height: 1.3em;
  margin: -5px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.meal-photo-status[data-status="working"] {
  color: var(--cyan);
}

.meal-photo-status[data-status="success"] {
  color: #67e8a5;
}

.meal-photo-status[data-status="error"] {
  color: #ff9aa8;
}

.meal-slot-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.meal-summary {
  margin-top: 16px;
}

.meal-log-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.meal-log-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meal-log-top span,
.meal-log-product,
.empty-note {
  color: var(--muted);
}

.meal-log-items {
  color: #f2eeff;
}

.meal-log-top span {
  margin-left: auto;
  font-size: 0.8em;
}

.meal-log-delete {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 111, 145, 0.34);
  border-radius: 999px;
  background: rgba(80, 31, 58, 0.82);
  color: #ffd0da;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.meal-log-delete:active {
  background: rgba(128, 45, 81, 0.95);
}

.meal-log-advice {
  color: #d9d4ea;
  font-size: 0.86rem;
  line-height: 1.5;
}

.meal-badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.level-多め {
  background: rgba(255, 111, 145, 0.16);
  color: #ffc0cf;
}

.level-やや多め {
  background: rgba(255, 206, 112, 0.16);
  color: #ffdfa0;
}

.level-少なめ {
  background: rgba(125, 255, 122, 0.16);
  color: #beffbc;
}

.vault-toolbar {
  justify-content: flex-end;
  margin-bottom: 10px;
}

.vault-toolbar button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(73, 225, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(38, 27, 69, 0.96), rgba(17, 18, 42, 0.98));
  color: #e8ddff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: inset 0 0 12px rgba(155, 77, 255, 0.08);
}

.vault-toolbar button:active {
  border-color: rgba(73, 225, 255, 0.62);
  color: #bcefff;
}

.vault-layout {
  min-height: 620px;
}

.vault-list,
.vault-editor {
  border-radius: 24px;
}

.vault-list {
  padding: 10px;
  overflow-y: auto;
}

.vault-item {
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
}

.vault-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

#vaultEditor {
  flex: 1;
  min-height: 520px;
}

.danger {
  background: rgba(255, 111, 145, 0.14);
  color: #ffd3dc;
  border: 1px solid rgba(255, 111, 145, 0.18);
  border-radius: 14px;
  padding: 8px 12px;
}

.wait-console {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(8, 10, 22, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 20px rgba(73, 225, 255, 0.2);
}

.wait-bars {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 18px;
}

.wait-bars span {
  width: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  animation: waitBar 1s ease-in-out infinite;
}

.wait-bars span:nth-child(1) {
  height: 8px;
}

.wait-bars span:nth-child(2) {
  height: 18px;
  animation-delay: 0.15s;
}

.wait-bars span:nth-child(3) {
  height: 12px;
  animation-delay: 0.3s;
}

.wait-copy {
  color: var(--cyan);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

@keyframes waitBar {
  0%, 100% { transform: scaleY(0.7); opacity: 0.7; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

@media (max-width: 900px) {
  .portal-feature-list {
    grid-template-columns: 1fr;
  }

  .memori-strip {
    grid-template-columns: 118px 1fr;
  }

  .memori-avatar-wrap {
    width: 118px;
    height: 118px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .portal-page,
  .app-shell {
    padding: 8px;
  }

  .portal-photo-main {
    width: min(200px, 50vw);
    height: min(200px, 50vw);
    margin: 12px auto 0;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
  }

  .app-header {
    order: 0;
  }

  .view-tabs {
    order: 1;
  }

  .memori-strip {
    order: 2;
  }

  main {
    order: 3;
  }

  .app-header,
  .memori-strip,
  .view-tabs {
    flex-shrink: 0;
  }

  main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin-top: 2px;
  }

  .app-header {
    align-items: center;
    padding: 3px 6px;
  }

  .app-header .eyebrow {
    display: none;
  }

  .app-header h1 {
    font-size: 0.86rem;
  }

  .header-actions {
    gap: 5px !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .ghost-button,
  .calendar-link {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.68rem;
    color: var(--muted);
    text-decoration: none;
  }

  body[data-view="talkView"] .memori-strip {
    display: none;
  }

  body[data-view="mealView"] .memori-strip {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
    border-radius: 16px;
  }

  body[data-view="mealView"] .memori-avatar-wrap {
    width: 92px;
    height: 92px;
    border-radius: 16px;
  }

  body[data-view="mealView"] .memori-avatar {
    border-radius: 13px;
  }

  body[data-view="mealView"] .memori-status p {
    max-height: 6.5em;
    overflow-y: auto;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .view.active {
    height: 100%;
    min-height: 0;
  }

  .portal-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-gallery button {
    height: 88px;
  }

  .memori-strip {
    grid-template-columns: 96px 1fr;
    gap: 10px;
  }

  .memori-avatar-wrap {
    width: 96px;
    height: 96px;
  }

  .meal-actions {
    flex-wrap: wrap;
  }

  .view-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }
  .view-tabs button,
  .view-tab-link {
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 2px;
    font-size: 0.71rem;
    line-height: 1;
    border-radius: 11px;
  }

  #talkView.active,
  #taskView.active,
  #mealView.active,
  #vaultView.active {
    height: 100%;
    min-height: 0;
    padding-top: 2px;
  }

  #talkView.active {
    grid-template-rows: minmax(0, 1fr) auto auto auto;
  }

  body[data-view="talkView"] .talk-panel-head {
    display: none;
  }

  .talk-quick-row {
    gap: 3px;
    padding-top: 0;
    padding-inline: 0;
  }

  .talk-quick-row button {
    flex: 1;
    min-height: 24px;
    padding: 2px 3px;
    font-size: 0.66rem;
    line-height: 1.1;
    border-radius: 999px;
  }

  .quick-note-launch-row {
    gap: 4px;
    padding: 0;
  }

  .quick-note-launch {
    min-height: 25px;
    padding: 2px 7px;
    border-radius: 9px;
    font-size: 0.7rem;
    line-height: 1.1;
  }

  .quick-note-count {
    min-width: 16px;
    height: 16px;
    margin-left: 3px;
    font-size: 0.61rem;
  }

  .talk-log {
    min-height: 0;
    padding: 4px 4px 6px;
    border-radius: 14px;
    gap: 5px;
  }

  .chat-form {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 2px;
    padding-bottom: calc(2px + env(safe-area-inset-bottom));
    background: rgba(11, 16, 34, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 14px;
  }

  .message {
    gap: 6px;
    max-width: 96%;
  }

  .message-avatar {
    width: 44px;
    height: 44px;
  }

  .bubble {
    padding: 7px 9px;
    font-size: 0.92rem;
  }

  .mic-button {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .catch-photo-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
    font-size: 0.68rem;
  }

  #chatInput {
    min-height: 34px;
    max-height: 68px;
    padding: 6px 8px;
  }

  .link-folder-chips {
    gap: 5px;
  }

  .link-folder-chip,
  .link-shelf-mini-button,
  .link-shelf-action {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.67rem;
  }

  .send-button {
    min-width: 42px;
    padding: 0 7px;
  }



  #newTaskInput {
    min-height: 44px;
    max-height: 84px;
  }

  #newTaskDateTime {
    min-height: 44px;
    font-size: 0.9rem;
  }

  .meal-slot-picker {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .meal-slot-picker button {
    min-height: 34px;
    padding: 4px 2px;
    font-size: 0.8rem;
  }

  .meal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .meal-header h2 {
    font-size: 1.35rem;
  }

  .meal-help {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .meal-panel {
    padding: 10px;
    border-radius: 18px;
  }

  .meal-form {
    gap: 6px;
    margin-top: 8px;
  }

  #mealItemsInput,
  #mealProductInput {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 0.82rem;
  }

  .meal-photo-field {
    min-height: 38px;
    padding: 2px;
  }

  .meal-photo-input {
    min-height: 32px;
    font-size: 0.76rem;
  }

  .meal-photo-input::file-selector-button {
    min-height: 32px;
    padding: 4px 8px;
  }

  .meal-photo-status {
    margin-top: -2px;
    font-size: 0.72rem;
  }

  .meal-actions .primary-button {
    min-height: 36px;
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  #taskView.active,
  #mealView.active,
  #vaultView.active {
    overflow-y: auto;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .vault-toolbar {
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
  }

  .vault-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .vault-editor {
    order: -1;
    padding: 8px;
    gap: 8px;
  }

  #vaultEditor {
    min-height: 92px;
    max-height: 28dvh;
  }

  .vault-list {
    min-height: 0;
    max-height: 42dvh;
  }

  .wait-console {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}
