/*
 * scd の部品。モックアップ (docs/mockups/*.dc.html) の「scd 共通」を元に、docs/02-design-system.md の仕様に合わせたもの。
 * モックアップの .phone は body.narrow に置き換えてある。色は base.css のトークンだけを使う。
 */

/* ---- 共通の小物 ---- */
.h { margin: 0; font-size: inherit; line-height: inherit; font-weight: 600; color: var(--text-bright); }
.sm { font-size: 12px; line-height: 18px; }
.xs { font-size: 11px; line-height: 16px; }
.dim { color: var(--text-dim); }
.faint { color: var(--faint); }
.bright { color: var(--text-bright); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.clip { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.sep { height: 0; margin: 0; border: 0; border-top: 1px solid var(--border); }
.icon { width: 16px; height: 16px; }

/* ボタンとタグのキーボードフォーカス */
.btn:focus-visible,
.tag-select:focus-visible,
.seg > :focus-visible,
.swatch:focus-visible,
.nav:focus-visible,
.tab:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 1px;
}

/* ---- ボタン ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 26px;
  padding: 0 12px;
  border: 1px solid var(--control);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--line); }
.btn-primary { border-color: var(--amber); color: var(--text-bright); }
.btn-text { border-color: transparent; color: var(--text-dim); }
.btn-text .icon { width: 14px; height: 14px; }
.icon-btn { width: 26px; padding: 0; border-color: transparent; color: var(--text); }
body.narrow .btn { height: 36px; padding: 0 12px; font-size: 14px; }
body.narrow .icon-btn { width: 36px; padding: 0; }

/* ---- 入力欄 ---- */
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lab { font-size: 11px; line-height: 16px; color: var(--text-dim); }
.inp {
  display: block;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 24px;
}
.inp::placeholder { color: var(--faint); }
.inp:focus { outline: 1px solid var(--amber); outline-offset: 0; }
textarea.inp { height: 76px; padding: 4px 8px; line-height: 22px; resize: none; }
body.narrow .inp { height: 36px; padding: 0 12px; font-size: 16px; line-height: 34px; }
body.narrow textarea.inp { height: 82px; padding: 4px 12px; line-height: 24px; }
fieldset.fs { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.fs > legend { padding: 0; }

/* ---- タグ ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  height: 18px;
  padding: 0 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.tag .icon { width: 12px; height: 12px; }
.tag .emo { font-size: 13px; }
body.narrow .tag { height: 20px; padding: 0 8px; }

/* ---- 選択式タグ ---- */
.tag-select,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.tag-select[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
body.narrow .tag-select,
body.narrow .chip { height: 36px; padding: 0 12px; }
body.narrow .chip.chip-face { width: 36px; padding: 0; justify-content: center; }

/* ---- 人のアイコン ---- */
.av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  outline: 2px solid var(--c, var(--faint));
  outline-offset: 1px;
  overflow: hidden;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av16 { width: 16px; height: 16px; outline-width: 1.5px; }
.av24 { width: 24px; height: 24px; font-size: 12px; }
.av64 { width: 64px; height: 64px; font-size: 24px; }

/* ---- 気分の顔 ---- */
.face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c);
}
.face .icon { width: 16px; height: 16px; }
.face.face-sm { width: 20px; height: 20px; }
.face.face-sm .icon { width: 14px; height: 14px; }
.face.is-selected { border-color: var(--c); }
.face-empty {
  display: inline-block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px dashed var(--faint);
}

/* ---- セグメント ---- */
.seg {
  display: inline-flex;
  flex: 0 0 auto;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.seg > button,
.seg > a {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.seg > button[aria-pressed="true"], .seg > a[aria-current="page"] { background: var(--line); color: var(--text-bright); }
body.narrow .seg { height: 36px; }
body.narrow .seg > button,
body.narrow .seg > a { padding: 0 12px; font-size: 14px; }

/* ---- 帯 (予定) ---- */
.band {
  display: block;
  min-width: 0;
  height: 20px;
  padding: 0 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--c) 30%, transparent);
  color: var(--text-bright);
  font-size: 11.5px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.narrow .band { height: 16px; font-size: 10.5px; line-height: 16px; }
.band.band-row,
body.narrow .band.band-row { flex: 0 1 auto; height: 22px; font-size: inherit; line-height: 22px; }

/* ---- 行 ---- */
.row { display: flex; align-items: center; gap: 8px; height: 28px; min-width: 0; }
body.narrow .row.row-tall { height: 44px; }

/* ---- 色見本 ---- */
.swatch {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
}
.swatch[aria-pressed="true"] { outline: 1px solid var(--text-bright); outline-offset: 2px; }
body.narrow .swatch { width: 24px; height: 24px; }

/* ---- 表 ---- */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th {
  height: 28px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.tbl td {
  height: 28px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.tbl .c-av { width: 32px; padding: 0; text-align: center; }
.tbl .c-av .av { vertical-align: middle; }
.tbl .num { text-align: right; }
