/*
 * TUTURIGACHI 2026 / 総務部
 * Copyright (C) 2026 Tuturigachi Language Solutions Corp. All Rights Reserved.
 * PDFに署名・押印（署名の枠、署名の操作）
 * 押印ツール（style.css の .t-inkan / .t-pdf）と同じ部品に、署名の枠と操作を足すもの。
 */

.t-shomei__dept { margin: 14px 0 -4px; font-size: 11px; letter-spacing: 0.12em; color: var(--kusumi-gold-700); }

/* ---- 署名の枠 ---- */

.t-shomei [hidden] { display: none !important; }
.t-shomei {
  margin: 0; border: 1px solid var(--jimu-gray-300); border-radius: 3px; background: #fff;
  box-shadow: 0 1px 2px oklch(0.4 0.02 210 / 0.08);
}
.t-shomei button:focus-visible, .t-shomei .t-btn:focus-visible { outline: 2px solid var(--fukagawa-teal-700); outline-offset: 2px; }
.t-shomei .t-btn:disabled {
  cursor: default; color: oklch(0.64 0.006 210); text-shadow: none; border-color: oklch(0.82 0.006 210);
  background: var(--shironezumi-50); box-shadow: none;
}
.t-shomei .t-btn:disabled::before { border-left-color: oklch(0.8 0.006 210); }

.t-shomei__modes {
  display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid oklch(0.78 0.008 210);
  background: linear-gradient(oklch(0.97 0.003 210), oklch(0.93 0.005 210)); border-radius: 3px 3px 0 0;
}
.t-shomei__mode {
  position: relative; top: 1px; min-height: 32px; padding: 0 16px; cursor: pointer;
  font: bold 12.5px/1.2 var(--font-agency-ja); letter-spacing: 0.04em; color: var(--sumi-sub); text-shadow: 0 1px 0 #fff;
  border: 1px solid oklch(0.78 0.008 210); border-radius: 3px 3px 0 0;
  background: linear-gradient(oklch(0.98 0.002 210), oklch(0.91 0.006 210));
}
.t-shomei__mode:hover { color: var(--fukagawa-teal-800); background: linear-gradient(#fff, var(--fukagawa-teal-100)); }
.t-shomei__mode[aria-selected="true"] {
  color: var(--fukagawa-teal-800); border-bottom-color: #fff; background: #fff; cursor: default;
  box-shadow: inset 0 2px 0 var(--fukagawa-teal-500);
}

.t-shomei__panel { padding: 16px 20px 14px; background: linear-gradient(#fff 60%, var(--shironezumi-50)); }
.t-shomei__kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 12px; padding: 0 0 10px; border: 0; border-bottom: 1px dotted var(--jimu-gray-300); }
.t-shomei__kinds legend { float: left; padding: 0; margin-right: 6px; line-height: 30px; }
.t-shomei__frame[data-kind="init"] .t-shomei__line { left: 30%; right: 30%; }
.t-shomei__frame[data-kind="init"] .t-shomei__x { left: 30%; }
.t-shomei__opts { min-height: 34px; margin: 0 0 12px; }
.t-shomei__say { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--sumi); }
.t-shomei__row { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; min-width: 0; margin: 0 0 10px; padding: 0; border: 0; }
.t-shomei__row:last-child { margin-bottom: 0; }
fieldset.t-shomei__row { display: block; }
fieldset.t-shomei__row > legend { float: left; width: 72px; padding: 0; line-height: 34px; }
.t-shomei__label { font-size: 13px; font-weight: bold; line-height: 1.35; color: var(--fukagawa-teal-800); }
.t-shomei .t-shomei__name { max-width: 320px; height: 34px; font-size: 15px; }
.t-shomei__faces .t-inkan__choices label { min-height: 38px; padding: 2px 10px 2px 7px; gap: 7px; }
.t-shomei__face { display: inline-block; max-width: 9em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 21px; line-height: 1.3; color: var(--sumi); text-shadow: none; }
.t-shomei__face--cedarville { font-family: 'Sign Cedarville', cursive; font-size: 22px; }
.t-shomei__face--caveat { font-family: 'Sign Caveat', cursive; }
.t-shomei__face--kaushan { font-family: 'Sign Kaushan', cursive; font-size: 19px; }
.t-shomei__face--klee { font-family: 'Sign Klee', serif; font-size: 18px; }
.t-shomei__faces .t-inkan__choices label small { font-family: var(--font-agency-en); }

.t-shomei__photo { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.t-shomei__photo .t-pdf__file-input { left: 0; bottom: 0; }
.t-shomei__photo:has(.t-pdf__file-input:focus-visible) .t-btn { outline: 2px solid var(--fukagawa-teal-700); outline-offset: 2px; }
.t-shomei__hint { flex: 1 1 18em; font-size: 11px; line-height: 1.6; color: var(--sumi-sub); }
.t-shomei__level { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.t-shomei__level small { font-size: 11px; line-height: 1.5; color: var(--sumi-sub); }

.t-shomei__frame {
  position: relative; aspect-ratio: 3 / 1; overflow: hidden; touch-action: none;
  background: linear-gradient(135deg, #fffefb, oklch(0.985 0.006 85));
  border: 1px solid oklch(0.86 0.008 85); border-radius: 2px;
  box-shadow: 0 1px 3px oklch(0.35 0.02 85 / 0.18), 0 0 0 4px oklch(0.96 0.004 210);
}
.t-shomei__canvas { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.t-shomei__frame[data-mode="type"] .t-shomei__canvas, .t-shomei__frame[data-mode="photo"] .t-shomei__canvas { cursor: default; }
.t-shomei__line { position: absolute; left: 6%; right: 6%; top: 72%; z-index: 1; border-top: 1px solid oklch(0.8 0.012 85); pointer-events: none; }
.t-shomei__x { position: absolute; left: 6%; top: 72%; z-index: 1; margin-top: -24px; font: 18px/20px var(--font-agency-en); color: oklch(0.72 0.012 85); pointer-events: none; }
.t-shomei__empty {
  position: absolute; left: 0; right: 0; top: 44%; z-index: 1; text-align: center; pointer-events: none;
  font-size: 13px; letter-spacing: 0.2em; color: oklch(0.8 0.01 85);
}
.t-shomei__frame.is-inked .t-shomei__empty { display: none; }
.t-shomei__frame[data-mode="photo"] .t-shomei__line, .t-shomei__frame[data-mode="photo"] .t-shomei__x { display: none; }

.t-shomei__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 14px 0 0; }
.t-shomei__ink { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; border: 0; }
.t-shomei__ink legend { float: left; padding: 0; margin-right: 10px; line-height: 30px; }
.t-shomei__swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.2); }
.t-shomei__swatch--black { background: #1b1b1d; }
.t-shomei__swatch--blue { background: #1d3b8f; }
.t-shomei__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.t-shomei .t-shomei__btns .t-btn { height: 26px; font-size: 11.5px; }
.t-shomei__status { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--sumi); }
.t-shomei__status:empty { display: none; }
.t-shomei__private { margin: 0; padding: 8px 14px 9px 31px; border-top: 1px solid var(--jimu-gray-200); background: var(--shironezumi-50); border-radius: 0 0 3px 3px; }
.t-shomei__private::before { left: 15px; top: 14px; }
.t-shomei__private::after { left: 17px; top: 9px; }

/* ---- 印鑑（署名捺印） ---- */

.t-shomei__seal { border-top: 1px solid var(--jimu-gray-200); background: #fff; }
.t-shomei__seal > summary {
  cursor: pointer; padding: 10px 20px; font-size: 13px; font-weight: bold; color: var(--fukagawa-teal-800);
  list-style-position: inside;
}
.t-shomei__seal > summary:hover { background: var(--fukagawa-teal-100); }
.t-shomei__seal > summary:focus-visible { outline: 2px solid var(--fukagawa-teal-700); outline-offset: -2px; }
.t-shomei__sealbody { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px 20px; align-items: start; padding: 4px 20px 16px; }
.t-shomei__sealform { display: grid; gap: 6px; min-width: 0; }
.t-shomei .t-shomei__sealin { max-width: 200px; height: 34px; font-size: 16px; }
.t-shomei__sealform .t-shomei__hint { margin: 0; }
.t-shomei__sealmsg { margin: 0; font-size: 12px; line-height: 1.6; color: var(--sumi); }
.t-shomei__sealmsg:empty { display: none; }
.t-shomei__sealview {
  width: 120px; height: 120px; border-radius: 2px; background: linear-gradient(135deg, #fffefb, oklch(0.985 0.006 85));
  box-shadow: inset 0 0 0 1px oklch(0.88 0.008 85);
}

/* ---- 署名の操作（押印ツールの .t-pdf__bar に、行を一つ足す） ---- */

.t-pdf--sign .t-pdf__bar { grid-template-areas: "name save" "adds adds" "edit edit"; }
.t-pdf--sign .t-pdf__adds { grid-area: adds; }
.t-pdf--sign .t-pdf__edit { grid-area: edit; min-height: 28px; }
.t-pdf--sign .t-pdf__edit:not(:has(:enabled)) { opacity: 0.85; }
.t-pdf__datepair { display: inline-flex; align-items: center; gap: 4px; }
.t-pdf__ticks { display: inline-flex; gap: 4px; }
.t-pdf .t-pdf__tick { min-width: 32px; padding: 0 8px; justify-content: center; font: bold 15px/1 var(--font-agency-en); }
.t-pdf .t-pdf__tick::before { display: none; }
.t-pdf .t-pdf__datefmt { height: 28px; padding: 2px 4px; font: 12px var(--font-dates); }
.t-pdf__textin {
  box-sizing: border-box; width: 15em; height: 26px; padding: 2px 6px; font: 13px var(--font-agency-ja); color: var(--sumi);
  border: 1px solid oklch(0.74 0.008 210); border-radius: 2px; background: #fff; box-shadow: inset 1px 1px 2px oklch(0 0 0 / 0.12);
}
.t-pdf__textin:focus { outline: 2px solid var(--fukagawa-teal-700); outline-offset: 0; }
#pdf-unit { display: inline-block; min-width: 1.6em; font: 11px var(--font-dates); color: var(--sumi-sub); }

.t-pdf__stamp--text { cursor: move; }
.t-pdf__text { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.t-pdf__stamp--text:not(.is-selected) { outline: 1px dotted oklch(0.62 0.04 210 / 0.55); outline-offset: 1px; }

/* ---- この署名について ---- */

.t-shomei__about { margin: 28px 0 0; padding: 2px 0 0; font-size: 12.5px; line-height: 1.9; }
.t-shomei__about p { margin: 6px 0 0; }

@media (max-width: 760px) {
  .t-fluid .t-shomei__modes { padding: 8px 8px 0; gap: 3px; }
  .t-fluid .t-shomei__mode { flex: 1 1 0; min-height: 44px; padding: 0 4px; font-size: 12px; line-height: 1.25; }
  .t-fluid .t-shomei__panel { padding: 14px 12px 12px; }
  .t-fluid .t-shomei__row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .t-fluid fieldset.t-shomei__row > legend { float: none; width: auto; margin: 0 0 6px; line-height: 1.35; }
  .t-fluid .t-shomei .t-shomei__name { max-width: none; height: 44px; font-size: 16px; }
  .t-fluid .t-shomei__faces .t-inkan__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .t-fluid .t-shomei__faces .t-inkan__choices label { min-height: 48px; }
  .t-fluid .t-shomei__frame { aspect-ratio: 5 / 2; }
  .t-fluid .t-shomei__photo .t-btn { height: 40px; padding: 0 14px; }
  .t-fluid .t-shomei__level .t-pdf__range { width: 100%; height: 36px; }
  .t-fluid .t-shomei__foot { align-items: stretch; }
  .t-fluid .t-shomei__ink .t-inkan__choices { display: flex; gap: 6px; }
  .t-fluid .t-shomei__ink .t-inkan__choices label { min-height: 40px; padding: 4px 14px 4px 8px; }
  .t-fluid .t-shomei__btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .t-fluid .t-shomei__btns #sign-png { grid-column: 1 / -1; }
  .t-fluid .t-shomei .t-shomei__btns .t-btn { height: 40px; padding: 0 4px; justify-content: center; white-space: nowrap; font-size: 12px; }
  .t-fluid .t-shomei__private { padding-right: 10px; }
  .t-fluid .t-shomei__kinds .t-inkan__choices label { min-height: 40px; padding: 4px 12px 4px 8px; }
  .t-fluid .t-shomei__seal > summary { padding: 12px; min-height: 44px; box-sizing: border-box; }
  .t-fluid .t-shomei__sealbody { grid-template-columns: minmax(0, 1fr) 96px; gap: 10px 12px; padding: 4px 12px 14px; }
  .t-fluid .t-shomei .t-shomei__sealin { max-width: none; height: 44px; }
  .t-fluid .t-shomei__sealview { width: 96px; height: 96px; }

  .t-fluid .t-pdf--sign .t-pdf__bar {
    top: -92px; grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas: "name name name name close close" "fmt fmt fmt fmt fmt fmt" "add add init init seal seal"
      "date date text text check cross" "edit edit edit edit edit edit" "save save save save save save";
    gap: 8px 6px; padding: 8px;
  }
  .t-fluid .t-pdf--sign .t-pdf__save, .t-fluid .t-pdf--sign .t-pdf__adds, .t-fluid .t-pdf--sign .t-pdf__datepair,
  .t-fluid .t-pdf--sign .t-pdf__ticks { display: contents; }
  .t-fluid .t-pdf--sign #pdf-init { grid-area: init; }
  .t-fluid .t-pdf--sign #pdf-seal { grid-area: seal; }
  .t-fluid .t-pdf--sign #pdf-check { grid-area: check; min-width: 0; }
  .t-fluid .t-pdf--sign #pdf-cross { grid-area: cross; min-width: 0; }
  .t-fluid .t-pdf--sign .t-pdf__name { height: 30px; line-height: 30px; }
  .t-fluid .t-pdf--sign #pdf-close { grid-area: close; justify-self: end; height: 30px; }
  .t-fluid .t-pdf--sign #pdf-save { grid-area: save; justify-self: stretch; }
  .t-fluid .t-pdf--sign #pdf-add { grid-area: add; }
  .t-fluid .t-pdf--sign #pdf-date { grid-area: date; }
  .t-fluid .t-pdf--sign #pdf-text-add { grid-area: text; }
  .t-fluid .t-pdf .t-pdf__datefmt { grid-area: fmt; width: 100%; height: 40px; font-size: 15px; }
  .t-fluid .t-pdf--sign .t-pdf__bar .t-btn { height: 44px; padding: 0 4px; justify-content: center; white-space: nowrap; font-size: 13px; }
  .t-fluid .t-pdf--sign .t-pdf__bar .t-btn::before { margin-right: 4px; }
  .t-fluid .t-pdf--sign .t-pdf__adds .t-btn { white-space: normal; line-height: 1.15; text-align: center; font-size: 12.5px; }
  .t-fluid .t-pdf--sign .t-pdf__adds .t-btn::before { display: none; }
  .t-fluid .t-pdf--sign .t-pdf__bar #pdf-close { height: 30px; font-size: 11px; }
  .t-fluid .t-pdf--sign .t-pdf__edit {
    grid-area: edit; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 10px;
    padding-top: 8px; border-top: 1px solid oklch(0.86 0.006 210);
  }
  .t-fluid .t-pdf--sign .t-pdf__edit:not(:has(.t-pdf__num:enabled)) { display: none; }
  .t-fluid .t-pdf--sign .t-pdf__ctl:has(#pdf-size), .t-fluid .t-pdf--sign .t-pdf__ctl:has(#pdf-rot), .t-fluid .t-pdf--sign #pdf-del { grid-area: auto; }
  .t-fluid .t-pdf--sign .t-pdf__ctl:has(#pdf-rot) { grid-column: 2 / -1; }
  .t-fluid .t-pdf--sign #pdf-all { grid-column: 1 / 3; justify-self: start; }
  .t-fluid .t-pdf--sign .t-pdf__textctl { grid-column: 1 / -1; display: flex; }
  .t-fluid .t-pdf__textin { flex: 1; width: auto; min-width: 0; height: 40px; font-size: 16px; }
  .t-fluid .t-pdf--sign .t-pdf__ctl:has(#pdf-rot) { min-width: 0; }
  .t-fluid .t-pdf--sign .t-pdf__num { height: 40px; width: 58px; font-size: 16px; }
  .t-fluid .t-pdf--sign .t-pdf__range { flex: 1; min-width: 0; width: auto; height: 40px; }
  .t-fluid .t-pdf--sign .t-pdf__ctl output { min-width: 2.4em; }
  .t-fluid .t-pdf--sign .t-pdf__bar #pdf-del, .t-fluid .t-pdf--sign .t-pdf__bar #pdf-all { height: 40px; padding: 0 10px; }
}
