:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --panel-strong: #f9fbf8;
  --ink: #18201b;
  --muted: #66716a;
  --line: #dce4dc;
  --line-strong: #b9c8b9;
  --green: #276749;
  --green-soft: #e7f4eb;
  --blue: #245a86;
  --blue-soft: #e7f0f7;
  --yellow: #a76505;
  --yellow-soft: #fff3d8;
  --red: #b73831;
  --red-soft: #fee9e7;
  --violet: #6357a4;
  --violet-soft: #efedfa;
  --shadow: 0 16px 36px rgba(28, 45, 33, 0.08);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(36, 90, 134, 0.18);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(39, 103, 73, 0.05) 0 1px, transparent 1px 120px),
    linear-gradient(0deg, rgba(36, 90, 134, 0.04) 0 1px, transparent 1px 120px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  width: min(1480px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-block,
.top-actions,
.form-row,
.panel-heading,
.column-title,
.dialog-actions,
.task-card__actions,
.task-card__meta,
.phrase-actions,
.notice-meta,
.staff-row {
  display: flex;
  align-items: center;
}

.brand-block {
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #7a8f28);
  border-radius: var(--radius);
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-block p,
.save-state,
label span,
.task-card__meta,
.notice-meta,
.staff-role,
.empty-state,
.translated-label {
  color: var(--muted);
}

.brand-block p {
  margin-top: 3px;
  font-size: 14px;
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-switch {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.user-switch span {
  font-size: 12px;
  font-weight: 900;
}

.user-switch select {
  min-height: 30px;
  padding: 4px 8px;
}

#accessBadge {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  white-space: nowrap;
}

#accessBadge[data-level="owner"] {
  background: var(--violet-soft);
  color: var(--violet);
}

#accessBadge[data-level="manager"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-button,
.text-button,
.primary-action,
.chip-button,
.status-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  white-space: nowrap;
}

.icon-button svg,
.primary-action svg,
.text-button svg,
.chip-button svg,
.status-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-button:hover,
.text-button:hover,
.chip-button:hover,
.status-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-strong);
}

.icon-button:active,
.text-button:active,
.primary-action:active,
.chip-button:active,
.status-button:active {
  transform: translateY(1px);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.menu-bar {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: thin;
}

.menu-item {
  flex: 0 0 auto;
  min-width: 76px;
  background: transparent;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.command-panel,
.board-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.command-panel {
  position: sticky;
  top: 12px;
  padding: 16px;
}

.board-panel {
  min-width: 0;
  overflow: hidden;
}

.home-head,
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.home-head h2,
.page-toolbar h2 {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.panel-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.panel-heading h2,
.notice-form h2 {
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.save-state {
  font-size: 12px;
  white-space: nowrap;
}

.task-form,
.recurring-form,
.notice-form,
.share-form,
.delivery-form,
.translation-form,
.handover-form,
.dialog-card {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 12px;
  font-weight: 800;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 auto;
}

.field-status {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field-status[data-status="ok"] {
  border-color: #bdd7c5;
  background: var(--green-soft);
  color: var(--green);
}

.field-status[data-status="bad"] {
  border-color: #efc5bd;
  background: var(--red-soft);
  color: var(--red);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--blue);
  box-shadow: var(--focus);
  outline: none;
}

.form-row {
  gap: 10px;
}

.form-row.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.form-row.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.form-row label {
  min-width: 0;
  flex: 1;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 42px;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.primary-action:hover {
  background: #1f573c;
}

.primary-action.narrow {
  width: fit-content;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  font-weight: 800;
}

.panel-divider {
  height: 1px;
  margin: 18px -16px 14px;
  background: var(--line);
}

.staff-list {
  display: grid;
  gap: 8px;
}

.staff-row {
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.staff-row > div:first-child {
  min-width: 0;
}

.staff-row strong {
  display: block;
  font-size: 14px;
}

.staff-role {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.language-pill,
.priority-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.language-pill {
  background: var(--blue-soft);
  color: var(--blue);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.tab {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tab:hover {
  background: #fff;
}

.tab.is-active {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.tab-page {
  display: none;
  padding: 14px;
}

.tab-page.is-visible {
  display: block;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.home-card,
.task-entry-card,
.history-filters,
.history-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task-entry-card {
  margin-bottom: 14px;
}

.timeline-list,
.daily-checklist,
.history-results {
  display: grid;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.timeline-row[data-kind="recurring"] {
  border-left: 4px solid var(--green);
}

.timeline-row[data-kind="task"] {
  border-left: 4px solid var(--blue);
}

.timeline-row[data-done="true"] {
  opacity: 0.68;
}

.timeline-time {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
}

input.timeline-time {
  width: 100%;
  padding: 6px 8px;
}

.timeline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timeline-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.timeline-body b,
.daily-row__content strong,
.history-row strong {
  overflow-wrap: anywhere;
}

.timeline-body span,
.daily-row__content span,
.history-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.recurring-form {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.quick-task-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.daily-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.daily-row[data-done="true"] .daily-row__content {
  opacity: 0.62;
  text-decoration: line-through;
}

.daily-row input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}

.daily-row__content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-row__controls {
  display: grid;
  grid-template-columns: 112px minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.page-toolbar {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.staff-table {
  gap: 10px;
}

.staff-table .staff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 70px;
}

.history-filters {
  display: grid;
  grid-template-columns: 180px 240px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.history-summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.history-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.settings-card.wide {
  grid-column: 1 / -1;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.settings-row.stacked {
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1fr) auto;
  align-items: start;
}

.settings-row.language-row {
  grid-template-columns: 100px minmax(140px, 1fr) minmax(130px, 1fr) auto auto;
}

.settings-row strong,
.settings-row span {
  display: block;
}

.settings-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.phrase-editor {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  letter-spacing: 0;
}

.metric small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-column {
  min-width: 0;
  min-height: 560px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.column-title {
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 10px;
}

.column-title h2 {
  font-size: 15px;
}

.column-title span {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.task-list,
.notice-feed,
.phrase-list {
  display: grid;
  gap: 10px;
}

.task-card,
.notice-card,
.phrase-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.task-card.is-urgent {
  border-color: #ef9c96;
  box-shadow: inset 4px 0 0 var(--red);
}

.task-card.is-high {
  border-color: #e4c070;
  box-shadow: inset 4px 0 0 #d9971f;
}

.task-card__title {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: flex-start;
}

.task-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0;
}

.task-card__meta {
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.35;
}

.priority-pill.normal {
  background: var(--green-soft);
  color: var(--green);
}

.priority-pill.high {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.priority-pill.urgent {
  background: var(--red-soft);
  color: var(--red);
}

.translated-box {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: #173b5b;
}

.translated-label {
  font-size: 11px;
  font-weight: 900;
}

.translated-text {
  font-size: 14px;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.translator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.translator-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.translator-card textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.translator-result-card textarea {
  min-height: 320px;
  background: #f8fbf9;
  font-size: 15px;
  line-height: 1.55;
}

.field-mode-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.field-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.field-mode-toggle {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.field-mode-toggle strong {
  font-size: 20px;
  line-height: 1.2;
}

.field-mode-toggle span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.field-mode-toggle.is-on {
  border-color: rgba(39, 103, 73, 0.35);
  background: var(--green-soft);
  color: var(--green);
}

.ptt-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-height: 190px;
  padding: 22px 14px;
  border: 1px solid rgba(36, 90, 134, 0.28);
  border-radius: var(--radius);
  background: #f7fbfd;
  color: var(--blue);
  text-align: center;
  touch-action: none;
  user-select: none;
}

.ptt-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ptt-button.is-listening {
  border-color: rgba(183, 56, 49, 0.45);
  background: var(--red-soft);
  color: var(--red);
}

.ptt-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
}

.ptt-icon svg {
  width: 34px;
  height: 34px;
}

.ptt-button strong {
  font-size: 24px;
  line-height: 1.15;
}

.ptt-button span:last-child {
  max-width: 32ch;
  color: #314f66;
  font-size: 15px;
  line-height: 1.4;
}

.ptt-button.is-listening span:last-child {
  color: #72302c;
}

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

.field-quick-grid button {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
}

.field-result-card textarea {
  width: 100%;
  resize: vertical;
}

.field-result-card textarea[readonly] {
  min-height: 210px;
  background: #f8fbf9;
  font-size: 16px;
  line-height: 1.55;
}

.field-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.task-card__memo {
  color: #39423d;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.task-card__actions {
  gap: 6px;
  flex-wrap: wrap;
}

.status-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.chip-button.works-dispatch {
  background: var(--green-soft, #e7f3ea);
  border-color: #9fc7ab;
  color: var(--green, #1e6b3a);
}

.home-dispatch-all {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  margin-bottom: 14px;
}

.form-collapse > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--green, #1e6b3a);
  list-style: none;
  padding: 4px 2px;
}

.form-collapse > summary::-webkit-details-marker {
  display: none;
}

.form-collapse[open] > summary {
  margin-bottom: 8px;
}

.status-button[data-next="todo"] {
  background: #fff;
}

.status-button[data-next="doing"] {
  background: var(--yellow-soft);
  border-color: #e8cd8a;
  color: #704400;
}

.status-button[data-next="done"] {
  background: var(--green-soft);
  border-color: #bdd7c5;
  color: var(--green);
}

.delete-button {
  margin-left: auto;
  color: var(--red);
}

.danger-action {
  border-color: #efc5bd;
  color: var(--red);
}

.message-layout,
.share-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.notice-form,
.notice-card,
.phrase-card,
.share-form,
.delivery-summary-card,
.ops-card,
.sync-form,
.delivery-form,
.share-preview-card,
.translation-form,
.handover-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.share-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-areas:
    "share preview"
    "plan preview"
    "ops preview"
    "sync preview"
    "delivery preview"
    "translation preview";
  align-items: start;
}

.share-form,
.delivery-form,
.sync-form,
.translation-form {
  align-content: start;
}

.share-form {
  grid-area: share;
}

.delivery-summary-card {
  display: grid;
  gap: 10px;
  grid-area: plan;
}

.ops-card {
  display: grid;
  gap: 10px;
  grid-area: ops;
}

.sync-form {
  display: grid;
  gap: 12px;
  grid-area: sync;
}

.delivery-form {
  grid-area: delivery;
}

.share-preview-card {
  display: grid;
  gap: 10px;
  grid-area: preview;
}

.translation-form {
  grid-area: translation;
}

.share-preview-card textarea {
  min-height: 430px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-actions .primary-action,
.share-actions .text-button {
  flex: 1 1 150px;
}

.integration-status {
  min-height: 38px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: #173b5b;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.delivery-plan {
  display: grid;
  gap: 8px;
}

.ops-list {
  display: grid;
  gap: 8px;
}

.ops-row {
  display: grid;
  grid-template-columns: minmax(82px, auto) 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.ops-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-row strong {
  text-align: right;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ops-row[data-status="ok"] {
  border-color: #bfd8c9;
  background: var(--green-soft);
  color: var(--green);
}

.ops-row[data-status="warn"] {
  border-color: #e8cd8a;
  background: var(--yellow-soft);
  color: #704400;
}

.ops-row[data-status="bad"] {
  border-color: #efc5bd;
  background: var(--red-soft);
  color: var(--red);
}

.delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.delivery-row strong,
.delivery-row span {
  display: block;
}

.delivery-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.delivery-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notice-card {
  display: grid;
  gap: 10px;
}

.notice-card p {
  white-space: pre-wrap;
  line-height: 1.5;
}

.notice-meta {
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.read-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.read-chip {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.read-chip.is-read {
  background: var(--green-soft);
  border-color: #bdd7c5;
  color: var(--green);
}

.phrase-toolbar {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.phrase-card {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.phrase-card strong {
  display: block;
  line-height: 1.4;
}

.phrase-card p {
  line-height: 1.45;
  color: #1b3f5e;
  overflow-wrap: anywhere;
}

.phrase-actions {
  gap: 6px;
  justify-content: flex-end;
}

.handover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(20, 28, 22, 0.35);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 132px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  font-size: 14px;
}

.empty-state svg {
  width: 28px;
  height: 28px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #17231c;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .workspace,
  .home-grid,
  .settings-grid,
  .message-layout,
  .share-layout,
  .translator-layout,
  .field-mode-layout {
    grid-template-columns: 1fr;
  }

  .share-layout {
    grid-template-areas:
      "share"
      "plan"
      "ops"
      "sync"
      "preview"
      "delivery"
      "translation";
  }

  .command-panel {
    position: static;
  }

  .board-grid {
    grid-template-columns: 1fr;
  }

  .daily-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .daily-row__controls {
    grid-column: 2;
    grid-template-columns: 112px minmax(120px, 1fr);
  }

  .history-filters {
    grid-template-columns: 1fr 1fr;
  }

  .status-column {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 16px, 1480px);
    padding-top: 8px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .icon-button,
  .top-actions .file-button {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 8px;
  }

  h1 {
    font-size: 19px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .menu-bar,
  .tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .tab,
  .menu-item {
    flex: 1 0 auto;
    padding: 0 12px;
  }

  .metrics-row,
  .form-row.three,
  .form-row.two,
  .history-filters,
  .phrase-toolbar,
  .share-actions,
  .translator-layout,
  .field-mode-layout,
  .handover-grid {
    grid-template-columns: 1fr;
  }

  .home-head,
  .page-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-row,
  .staff-table .staff-row,
  .history-row,
  .settings-row,
  .settings-row.stacked,
  .settings-row.language-row {
    grid-template-columns: 1fr;
  }

  .timeline-time {
    width: fit-content;
    padding: 0 10px;
  }

  .daily-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
  }

  .daily-row__controls {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .user-switch {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .share-actions {
    display: grid;
  }

  .field-quick-grid,
  .field-actions {
    grid-template-columns: 1fr;
  }

  .ptt-button {
    min-height: 168px;
  }

  /* 전달 화면: 발송 버튼을 화면 하단에 고정해 스크롤 없이 바로 탭 */
  .share-form .share-actions {
    position: sticky;
    bottom: 8px;
    z-index: 5;
    background: var(--panel, #fff);
    border-radius: 14px;
    box-shadow: 0 -6px 18px rgba(20, 40, 25, 0.12);
    padding: 10px;
  }

  .share-form .share-actions .primary-action {
    min-height: 52px;
    font-size: 16px;
  }

  .phrase-card {
    grid-template-columns: 1fr;
  }

  .phrase-actions {
    justify-content: flex-start;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .top-actions,
  .command-panel,
  .menu-bar,
  .tabs,
  .share-layout,
  .task-card__actions,
  .toast {
    display: none !important;
  }

  .workspace,
  .board-grid {
    display: block;
  }

  .board-panel,
  .status-column,
  .task-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .tab-page {
    display: block;
    padding: 10px 0;
  }

  .tab-page:not(#boardPage):not(#handoverPage) {
    display: none;
  }
}

/* ── 빠른지시 (태블릿 3탭 지시 플로우) ─────────────────────────────── */
.quick-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}

.quick-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.quick-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-strong);
  text-align: left;
  cursor: pointer;
}

.quick-chip strong {
  font-size: 16px;
  font-weight: 850;
}

.quick-chip span {
  font-size: 12px;
  color: var(--muted);
}

.quick-chip.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1.5px var(--green);
}

.quick-option-chip {
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-strong);
  font-weight: 850;
  cursor: pointer;
}

.quick-option-chip.is-on {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.quick-preview {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-preview__target {
  margin: 0;
  font-weight: 850;
  color: var(--green);
}

.quick-preview__ko {
  margin: 0;
  font-size: 15px;
}

.quick-preview__foreign {
  margin: 0;
  font-size: 15px;
  color: var(--blue);
}

.quick-actions {
  flex-direction: column;
  align-items: stretch;
}

.quick-actions .primary-action,
.quick-actions .text-button {
  flex: 0 0 auto;
  width: 100%;
}

.quick-actions .primary-action {
  min-height: 60px;
  font-size: 17px;
}

.quick-actions .text-button {
  min-height: 48px;
  font-size: 15px;
}

.chip-button.self-complete {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
  min-height: 52px;
  padding: 0 18px;
  font-size: 15px;
}

/* ── 간편(태블릿) 모드: 터치 목표 확대, 정보 밀도 축소 ───────────────── */
body[data-ui-mode="simple"] .tab {
  min-height: 56px;
  font-size: 16px;
  padding: 0 18px;
}

body[data-ui-mode="simple"] .chip-button {
  min-height: 52px;
  font-size: 15px;
}

body[data-ui-mode="simple"] .primary-action {
  min-height: 56px;
  font-size: 16px;
}

body[data-ui-mode="simple"] .home-dispatch-all {
  min-height: 64px;
  font-size: 18px;
}

body[data-ui-mode="simple"] .timeline-row {
  padding: 14px 12px;
}

body[data-ui-mode="simple"] .timeline-body b {
  font-size: 17px;
}

body[data-ui-mode="simple"] .timeline-body span {
  font-size: 14px;
}

body[data-ui-mode="simple"] .daily-row {
  padding: 14px 12px;
}

body[data-ui-mode="simple"] .daily-row input[type="checkbox"] {
  width: 26px;
  height: 26px;
}

body[data-ui-mode="simple"] .ptt-button {
  min-height: 200px;
}

/* hidden 속성은 어떤 display 규칙보다 우선 — 권한/모드로 숨긴 요소가 다시 보이는 사고 방지 */
[hidden] {
  display: none !important;
}

/* ── 동기화 상태 배지 (항상 표시 — 여러 기기 운영의 전제 조건) ─────────── */
.sync-badge {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  font-weight: 850;
  font-size: 12px;
  cursor: pointer;
  background: var(--panel-strong);
}

.sync-badge[data-state="off"] {
  border-color: #d9a13c;
  background: var(--yellow-soft);
  color: var(--yellow);
}

.sync-badge[data-state="error"] {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
  animation: sync-badge-pulse 1.6s ease-in-out infinite;
}

.sync-badge[data-state="ok"] {
  border-color: #9fc7ab;
  background: var(--green-soft);
  color: var(--green);
}

@keyframes sync-badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ── 결근 표시 ───────────────────────────────────────────────────── */
.quick-chip.is-absent {
  opacity: 0.55;
  border-style: dashed;
  background: var(--red-soft);
}

.quick-chip.is-absent span {
  color: var(--red);
  font-weight: 800;
}

.staff-row[data-absent="true"] {
  opacity: 0.6;
  background: var(--red-soft);
}

/* ── 읽음 확인 현황 (홈, 발송 버튼 아래) ─────────────────────────────── */
.confirm-watch {
  display: block;
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.confirm-watch[data-done="true"] {
  background: var(--green-soft);
  border-color: #9fc7ab;
  color: var(--green);
}
