/* ミセナレ Web 版
   売場の棚札と POP をよりどころにした、静かな画面。目立たせるのはハッシュタグ（POP黄の値札）だけ。 */

:root {
  --paper: #F2F4F3;      /* 棚札の白（冷たい白） */
  --surface: #FFFFFF;
  --ink: #1A2421;        /* 墨 */
  --ink-soft: #4B5753;
  --rule: #D5DBD8;
  --pop: #FFD60A;        /* POP黄：ハッシュタグ */
  --pop-soft: #FFF2B3;
  --sign: #1F5FBF;       /* 案内板の青：操作 */
  --sign-ink: #FFFFFF;
  --pending: #9A5B00;    /* 承認待ち */
  --error: #B3261E;
  --radius: 10px;
  --tap: 48px;
  font-family: 'BIZ UDPGothic', 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141A18;
    --surface: #1D2522;
    --ink: #E8EDEB;
    --ink-soft: #A9B4B0;
    --rule: #33403C;
    --pop-soft: #4A3F0C;
    --sign: #5B8FE0;
    --pending: #E0A243;
    --error: #FF8A80;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); min-height: 100dvh; font-size: 16px; line-height: 1.7; }

#app { display: flex; flex-direction: column; min-height: 100dvh; max-width: 640px; margin: 0 auto; }

/* 上の帯：店舗名と承認・管理 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--rule); background: var(--surface);
}
.store-name { font-weight: 700; }
.store-select { font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--ink); padding: 6px 0; }
.topbar-link { color: var(--sign); font-size: 15px; text-decoration: none; padding: 8px 0; }

.content { flex: 1; padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
.page { display: flex; flex-direction: column; gap: 12px; }
.center { align-items: center; text-align: center; padding-top: 30vh; }

h1 { font-size: 24px; line-height: 1.4; margin: 4px 0 4px; font-weight: 700; letter-spacing: 0.01em; }
h2 { font-size: 17px; line-height: 1.5; margin: 20px 0 0; font-weight: 700; }
p { margin: 0; }
.lead { font-size: 18px; }
.hint, .note { color: var(--ink-soft); font-size: 14px; }
.error { color: var(--error); font-weight: 700; }
.pending { color: var(--pending); font-weight: 700; }

.welcome .brand { font-size: 40px; letter-spacing: 0.08em; margin-top: 12vh; }

/* 下のタブ：親指が届く位置 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  min-height: 56px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 15px;
  border-top: 3px solid transparent;
}
.tab-active { color: var(--sign); border-top-color: var(--sign); }

/* 入力 */
label { font-size: 14px; font-weight: 700; margin-top: 8px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=search], textarea, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 12px 14px; min-height: var(--tap); width: 100%;
}
textarea { resize: vertical; line-height: 1.7; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--sign); }

:focus-visible { outline: 3px solid var(--sign); outline-offset: 2px; }

/* ボタン */
button { font: inherit; cursor: pointer; }
.primary, .secondary, .search-launch {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 10px 18px; border-radius: var(--radius);
  font-weight: 700; text-decoration: none; text-align: center;
}
.primary { background: var(--sign); color: var(--sign-ink); border: 0; }
.secondary { background: var(--surface); color: var(--sign); border: 1px solid var(--sign); }
.block { display: flex; width: 100%; }
.small { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.link, .back { background: none; border: 0; color: var(--sign); padding: 8px 0; text-align: left; font-weight: 700; align-self: flex-start; }

/* ホームの検索入口は、入力欄の形をしたボタン */
.search-launch {
  justify-content: flex-start; background: var(--surface); color: var(--ink-soft);
  border: 2px solid var(--ink); font-weight: 400; min-height: 56px; font-size: 17px;
}

.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; font-size: 17px; border: 2px solid var(--ink); }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap);
  padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 13px;
}

/* ハッシュタグ：POP の値札。角を1つ落として棚札の形にする */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pop); color: #1A2421; border: 0;
  font-weight: 700; font-size: 15px; line-height: 1;
  padding: 9px 12px 9px 14px; min-height: 36px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  border-radius: 0 4px 4px 0;
}
button.tag { cursor: pointer; }
.tag-quiet { background: var(--pop-soft); font-weight: 400; font-size: 14px; min-height: 30px; padding: 6px 10px 6px 12px; }
@media (prefers-color-scheme: dark) { .tag-quiet { color: var(--ink); } }
.tag-inline { min-height: 30px; }
.tag-x { font-weight: 400; opacity: 0.7; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chips { margin: 4px 0 8px; }

/* 候補とクイック提案 */
.suggest { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px; }
.suggest-list { list-style: none; margin: 0; padding: 0; }
.suggest-item {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: 0; padding: 6px 8px; color: var(--ink); text-align: left; border-radius: 6px;
}
.suggest-item:hover, .suggest-item:focus-visible { background: var(--paper); }
.suggest-count { color: var(--ink-soft); font-size: 13px; }
.suggest-new { color: var(--sign); font-weight: 700; }
.suggest-warn { font-size: 13px; color: var(--pending); margin: 0 8px 6px; }
.maybe-label { font-size: 13px; color: var(--ink-soft); margin: 8px 8px 0; border-top: 1px dashed var(--rule); padding-top: 8px; }
.proposals { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 検索結果：カードではなく、区切り線で並べる一覧 */
.hits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.hits li { border-bottom: 1px solid var(--rule); }
.hit { display: flex; flex-direction: column; gap: 6px; padding: 14px 2px; color: inherit; text-decoration: none; }
.hit-title { font-weight: 700; font-size: 17px; line-height: 1.5; }
.hit-snippet { color: var(--ink-soft); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hit-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fresh { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; justify-content: flex-end; margin-left: auto; color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.fresh-stale { color: var(--pending); }
.fresh-warn { color: var(--pending); font-weight: 700; }
.fresh-detail { display: flex; flex-direction: column; gap: 2px; color: var(--ink-soft); font-size: 14px; padding-top: 10px; border-top: 1px solid var(--rule); }
.linked { display: inline-block; margin-right: 6px; color: var(--sign); font-size: 13px; }

.empty { display: flex; flex-direction: column; gap: 10px; padding: 24px 0; }

/* ナレッジの詳細 */
.knowledge .body { display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.9; white-space: pre-wrap; max-width: 36em; }
.actions { display: flex; gap: 8px; margin-top: 8px; }

/* 商品 */
.product { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.product-name { font-size: 19px; font-weight: 700; line-height: 1.5; }
.product-meta { color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.camera { width: 100%; border-radius: var(--radius); background: #000; }

/* 承認・管理 */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.row a { color: var(--ink); font-weight: 700; }
.row-actions { display: flex; gap: 8px; margin-left: auto; }
.invite-link { font-size: 13px; }

.write { display: flex; flex-direction: column; gap: 8px; }
.write .primary { margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--radius);
  font-weight: 700; z-index: 20; max-width: calc(100% - 32px);
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 180ms ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
}

/* 承認・管理：開閉できるまとまり */
.panel { border: 1px solid var(--rule); background: var(--surface); margin: 0 0 12px; }
.panel > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; min-height: 48px; box-sizing: border-box; }
.panel[open] > summary { border-bottom: 1px solid var(--rule); }
.panel-body { padding: 4px 16px 16px; }
.panel-body h3 { font-size: 15px; margin: 16px 0 6px; }
.relation { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quote { font-weight: 700; }

/* 写真 */
.photo-section { margin: 16px 0; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-item { position: relative; margin: 0; width: calc(50% - 4px); }
.photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--rule); border: 1px solid var(--rule); display: block; }
.photo-item figcaption { font-size: 13px; padding: 4px 2px; }
.photo-remove {
  width: 32px; height: 32px; line-height: 1;
  border: 0; border-radius: 50%; background: rgba(26, 36, 33, .75); color: #fff; font-size: 18px; cursor: pointer;
}
.photo-add { width: calc(50% - 4px); display: flex; align-items: center; }
.photo-add .secondary { width: 100%; }
@media (min-width: 600px) { .photo-item, .photo-add { width: calc(33.333% - 6px); } }

/* 招待のQRコード */
.qr { max-width: 260px; margin: 12px auto; }
.qr svg { width: 100%; height: auto; display: block; }

/* 連絡・引き継ぎ */
.tab-count {
  display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px;
  border-radius: 9px; background: var(--error, #c0392b); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: text-top;
}
.home-alert { margin: 8px 0 16px; padding: 12px; background: var(--pop); border: 1px solid var(--ink); }
.home-alert a { color: var(--ink); font-weight: 700; }
.notices { display: flex; flex-direction: column; gap: 12px; }
.notice { padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); }
.notice h3 { margin: 0; font-size: 16px; }
.notice p { margin: 8px 0 0; }
.notice-important { border-left: 6px solid var(--error, #c0392b); }
.notice-unread { background: #fffdf2; }
.notice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.notice-badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700;
}
.notice-important .notice-head .notice-badge:first-child { background: var(--error, #c0392b); }
.notice-all { background: var(--sign); }
.notice-new { background: var(--pending); }
.notice-acked { color: var(--sign); font-weight: 700; }
.notice .primary { margin-top: 10px; }
.handover-form { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 16px; }
.handover-form textarea { flex: 1; margin: 0; }
.handover-form .primary { width: auto; min-width: 72px; }
.handover-body { flex: 1 1 100%; }
.handover-body.done { color: #6b7570; text-decoration: line-through; }
.handover-carried { background: #fffdf2; }
.fresh-detail .primary, .fresh-detail .secondary { margin-top: 10px; }

/* 引き継ぎの履歴 */
.scope-tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.scope-tab {
  flex: 1; min-height: 40px; padding: 8px 12px; font: inherit; font-weight: 700;
  background: var(--surface); color: var(--sign); border: 1px solid var(--sign); cursor: pointer;
}
.scope-tab-on { background: var(--sign); color: var(--sign-ink, #fff); }
.history { align-items: flex-start; }
.history-events { list-style: none; margin: 4px 0 0; padding: 0; flex: 1 1 100%; font-size: 13px; color: var(--ink-soft); }
.history-events li { padding: 1px 0; }
.history .notice-badge { margin-right: 6px; }
/* 消したものは本文だけに線を引く（状態の札には引かない） */
.history-deleted .history-text { color: var(--ink-soft); text-decoration: line-through; }
.history-done { background: var(--sign); }
.history-open { background: var(--pending); }

/* その場で出す確認（window.confirm は埋め込みで出ないことがあるため使わない） */
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.confirm-q { font-size: 13px; font-weight: 700; color: var(--pending); }
.photo-item .confirm { position: absolute; top: 4px; right: 4px; }
.photo-item .confirm-q { background: var(--surface); padding: 2px 6px; border-radius: 3px; }

/* タグの読みの確認：読みをその場で直せるようにする */
.reading-row { flex-wrap: wrap; align-items: center; gap: 8px; }
.reading-head { display: inline-flex; align-items: center; gap: 8px; }
.reading-field {
  flex: 1 1 140px; min-width: 120px; font-size: 16px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--text); font-family: inherit;
}
.reading-field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 保存した直後の、読みのその場確認 */
.reading-ask h1 { font-size: 20px; }
.reading-ask .rows { margin: 16px 0; }

/* 読みの候補。押すと入力欄に入るだけで、登録はしない */
.reading-candidates { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.reading-chip {
  font-size: 14px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; cursor: pointer;
}
.reading-chip:hover, .reading-chip:focus { border-color: var(--accent); }

/* 読みは複数入れられる */
.reading-fields { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.reading-line { display: flex; align-items: center; gap: 6px; }
.reading-line .reading-field { flex: 1 1 auto; }
.reading-remove {
  flex: 0 0 auto; width: 32px; height: 32px; line-height: 1; font-size: 18px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--muted); font-family: inherit; cursor: pointer;
}
.reading-remove:hover { color: var(--text); border-color: var(--accent); }
.reading-add {
  align-self: flex-start; font-size: 14px; padding: 4px 0;
  border: 0; background: none; color: var(--accent); font-family: inherit; cursor: pointer;
}

/* 出典表示。常に画面の下に置くが、作業の邪魔にならない大きさにする。 */
.credits {
  max-width: 720px; margin: 32px auto; padding: 0 16px 24px;
  color: var(--ink-soft); font-size: 12px; line-height: 1.8; text-align: center;
}
.credits a { color: inherit; text-decoration: underline; }

/* ログイン前の画面：パスキーで入る導線と、はじめての端末の区切り */
.welcome-signin { margin: 20px 0 8px; }
.welcome-signin .hint { margin-top: 6px; }
.welcome .or {
  margin: 24px 0 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.welcome .or::before, .welcome .or::after {
  content: ''; flex: 1; height: 1px; background: currentColor; opacity: 0.25;
}

/* ホームの足元から「この端末の設定」へ */
.home-foot { margin-top: 32px; font-size: 14px; }
.home-foot a { color: var(--ink-soft); }

/* スタッフ一覧：同名の注意と、会社アカウントのメールアドレス */
.warn-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #7A3E00; background: #FFE2B8;
}
@media (prefers-color-scheme: dark) {
  .warn-badge { color: #FFD9A0; background: #4A2D00; }
}
.staff-email { display: block; color: var(--ink-soft); font-size: 12px; word-break: break-all; }

/* 利用の申請：メールアドレスと、承認時に直せる名前・配属先 */
.request-row { align-items: flex-start; }
.request-who { display: flex; flex-direction: column; gap: 2px; }
.request-fields { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.request-fields .field { display: flex; flex-direction: column; gap: 2px; }
.request-fields input, .request-fields select { font: inherit; padding: 6px 8px; min-width: 120px; }

/* ホームの知らせが2行になることがあるので、縦に並べる */
.home-alert a { display: block; }
.home-alert a + a { margin-top: 6px; }

/* 会社のアカウントの設定フォーム */
.sso-form { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.sso-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.sso-form input[type="url"], .sso-form input[type="text"], .sso-form input[type="password"], .sso-form select {
  font: inherit; font-weight: 400; padding: 8px; width: 100%; box-sizing: border-box;
}
.sso-form .sso-jit { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.sso-form .sso-jit input { margin-top: 3px; }

/* つなぎを確かめた結果 */
.check-result { margin: 10px 0; font-size: 14px; }
.check-ok { color: var(--sign); font-weight: 700; }
.check-steps { list-style: none; padding: 0; margin: 6px 0; }
.check-steps li { padding: 3px 0; }
.check-steps .step-ng { color: #B3261E; }
@media (prefers-color-scheme: dark) { .check-steps .step-ng { color: #FFB4AB; } }
.check-steps .hint { display: block; padding-left: 1.3em; }

/* ドメインの確認の案内。情報システム部にそのまま写せるように */
.verify-box { margin: 8px 0; padding: 10px; border-radius: 6px; background: rgba(127, 127, 127, 0.1); }
.verify-record {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  overflow-x: auto; padding: 8px; margin: 6px 0; background: var(--paper); border-radius: 4px;
  -webkit-user-select: all; user-select: all;
}
