/* パスワード管理の画面。スケジュール管理アプリと同じ見た目にそろえる（色の名前・値も同じ）。ダークでは色を入れ替える。 */
:root {
  --bg: #f2f2f7; --surface: #fff; --surface-2: #efeff4; --ink: #1c1c1e; --muted: #6e6e73; --line: #e3e3e8;
  --work: #0066d6; --work-soft: #e6f1fd; --off: #1f7a37; --off-soft: #e3f5e8;
  --danger: #e0281e; --danger-soft: #fdeceb; --warn: #b25000;
  --on-work: #fff;
  --overlay: rgba(10, 18, 32, .5);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 24px rgba(0, 0, 0, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  color-scheme: light;
}
/* 画面の色: 端末の設定に合わせる（自動）。上の帯のアイコンで、ライト／ダークに固定できる（html の data-theme） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1522; --surface: #162033; --surface-2: #1e2b43; --ink: #e8eef8; --muted: #9aa8bd; --line: #2a3850;
    --work: #7ba2ff; --work-soft: #1b2c52; --off: #4fd0a8; --off-soft: #123a31;
    --danger: #ff8d80; --danger-soft: #3d1c19; --warn: #ffb26b;
    --on-work: #0b1220;
    --card-shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1522; --surface: #162033; --surface-2: #1e2b43; --ink: #e8eef8; --muted: #9aa8bd; --line: #2a3850;
  --work: #7ba2ff; --work-soft: #1b2c52; --off: #4fd0a8; --off-soft: #123a31;
  --danger: #ff8d80; --danger-soft: #3d1c19; --warn: #ffb26b;
  --on-work: #0b1220;
  --card-shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6;
  letter-spacing: .01em; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 0; }
a { color: var(--work); }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--work); outline-offset: 2px; }

input, select, textarea, button { font: inherit; color: inherit; letter-spacing: inherit; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; min-width: 0; padding: 8px 10px; border: .5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px;
}
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px;
  border: .5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; white-space: nowrap;
  font-weight: 500; box-shadow: 0 .5px 1px rgba(0, 0, 0, .05);
}
button:hover { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--work); border-color: transparent; color: var(--on-work); box-shadow: 0 2px 8px color-mix(in srgb, var(--work) 28%, transparent); }
button.primary:hover { filter: brightness(1.08); background: var(--work); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; box-shadow: none; }
button.danger.primary, .dialog button.danger#fp-ok { background: var(--danger); color: #fff; }
button.ghost { border-color: transparent; background: transparent; box-shadow: none; }
button.link { display: inline; border: 0; background: none; padding: 0; color: var(--work); text-decoration: underline; text-align: left; white-space: normal; box-shadow: none; font-weight: 400; }
button.small { padding: 3px 10px; font-size: 13px; border-radius: 8px; }

/* アイコン */
.ic { width: 1.15em; height: 1.15em; flex: none; display: block; }
.ic * { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ログインなど、中央の1枚 */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.card { background: var(--surface); border: .5px solid var(--line); border-radius: 14px; box-shadow: var(--card-shadow); padding: 28px 24px; width: 100%; max-width: 440px; }
.card .brand { color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.card > * + * { margin-top: 12px; }
.card > .brand + * { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: flex; gap: 6px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.lbl { font-size: 13px; color: var(--muted); }
.hint, .small { font-size: 13px; }
.muted { color: var(--muted); }
.err { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: 10px; margin: 0; }
.notice { background: var(--work-soft); padding: 8px 12px; border-radius: 10px; margin: 0; }
.warn { color: var(--warn); }
.check { display: flex; gap: 8px; align-items: center; }
.ver { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.select-all { user-select: all; -webkit-user-select: all; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.meter { font-size: 13px; margin-top: -6px; }
.meter.weak { color: var(--danger); }
.meter.mid { color: var(--warn); }
.meter.strong { color: var(--off); }
.reccode, .fp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem; letter-spacing: .04em; text-align: center;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; word-break: break-all;
}
.qr { max-width: 100%; height: auto; image-rendering: pixelated; align-self: center; background: #fff; border-radius: 6px; }

/* 上の帯 */
.topbar {
  position: sticky; top: 0; z-index: 10; border-bottom: .5px solid var(--line);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
}
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar .brand { font-weight: 600; font-size: 15px; letter-spacing: .02em; margin-right: 4px; }
.topbar .brand .ver { margin: 0 0 0 8px; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
/* 帯の部品（タブ・画面の色・設定・名前）は、高さと枠をそろえる */
.topbar { --bar-h: 32px; }
.tabs { display: flex; gap: 4px; height: var(--bar-h); background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 2px; border-radius: 10px; }
.tab { height: 100%; border: 0; background: transparent; padding: 0 16px; border-radius: 8px; color: var(--muted); font-size: 14px; box-shadow: none; }
.tab:hover { background: transparent; color: var(--ink); }
.tab.on { background: var(--surface); color: var(--work); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.spacer { flex: 1; }
.theme-sw { display: inline-flex; gap: 2px; height: var(--bar-h); padding: 2px; border: .5px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 .5px 1px rgba(0, 0, 0, .05); }
.theme-sw button { width: 30px; height: 100%; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); box-shadow: none; }
.theme-sw button:hover { color: var(--ink); background: transparent; }
.theme-sw button[aria-pressed="true"] { background: color-mix(in srgb, var(--work) 14%, var(--surface)); color: var(--work); }
.theme-sw .ic { width: 16px; height: 16px; }
.topbar-in > button.small, .menu > button.small { height: var(--bar-h); padding: 0 12px; border-radius: 10px; font-size: 14px; }
.topbar button.on { color: var(--work); border-color: var(--work); }
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; z-index: 20; padding: 6px; display: flex; flex-direction: column;
  background: var(--surface); border: .5px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
}
.menu-list button { justify-content: flex-start; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; box-shadow: none; font-weight: 400; }
.menu-list button:hover { background: var(--surface-2); }
.uname { max-width: 14em; overflow: hidden; text-overflow: ellipsis; }

/* 中身 */
.content { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 4px 0; }
.view-banner { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 10px; background: var(--work-soft); color: var(--work); }

.split { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.pane-list, .pane-detail, .card-s { background: var(--surface); border: .5px solid var(--line); border-radius: 14px; box-shadow: var(--card-shadow); }
.pane-list { padding: 12px; }
.pane-detail { padding: 20px; min-height: 200px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.filters { display: flex; gap: 8px; margin-bottom: 8px; }
.filters select { flex: 1; min-width: 0; font-size: 13px; padding: 6px 8px; }
.fav { color: var(--warn); }
.detail-head { flex-wrap: nowrap; align-items: flex-start; }
.detail-head h2 { overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 270px); overflow: auto; }
.list li.empty { padding: 16px 8px; color: var(--muted); }
.row-item {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 2px 8px; width: 100%; text-align: left;
  border: 0; border-radius: 10px; background: none; padding: 9px 10px; white-space: normal; box-shadow: none; font-weight: 400;
}
.row-item:hover { background: var(--surface-2); }
.row-item.on { background: var(--work-soft); }
.row-item .nm { font-weight: 600; flex: 1 1 100%; overflow-wrap: anywhere; }
.row-item .sub, .share-row .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.badge { font-size: 11.5px; font-weight: 500; background: var(--surface-2); border-radius: 99px; padding: 0 8px; }
.badge.gray { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; align-items: center; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { margin-top: 8px; border-top: .5px solid var(--line); padding-top: 12px; }

.settings, .admin { display: flex; flex-direction: column; gap: 16px; }
.settings { max-width: 760px; }
.card-s { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.card-s > h2:first-child { padding-bottom: 8px; border-bottom: .5px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: .5px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.tbl td { white-space: nowrap; }
.tbl td.small:nth-child(4) { white-space: normal; overflow-wrap: anywhere; min-width: 200px; }
.plain { margin: 0; padding-left: 18px; }
.history-row { gap: 4px; padding: 8px 0; border-top: .5px solid var(--line); }
.trust-row { justify-content: space-between; flex-wrap: nowrap; }
.trust-row .badge { margin-left: 8px; }
.grow { flex: 1; min-width: 0; }

.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.share-row { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: center; }

/* 小窓 */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto;
  background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.dialog { background: var(--surface); border: .5px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .28); padding: 22px; width: 100%; max-width: 560px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-weight: 500;
  transition: all .2s; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--danger); color: #fff; }

@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .list { max-height: none; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar { position: static; } /* スマホでは帯が2段になるので、画面を狭めないよう、付いてこさせない */
  .topbar-in { padding: 8px 12px; gap: 8px; }
  .topbar .brand .ver { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .tab { flex: 1; }
  .theme-sw button { width: 24px; }
  .topbar button .lbl-sm { display: none; }
  .uname { max-width: 8.5em; }
  .share-row { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .page-title { font-size: 24px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media print {
  .topbar, .toolbar, button { display: none !important; }
}
