:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #202020;
  --surface-3: #262626;
  --border: #343434;
  --border-strong: #4a4a4a;
  --text: #f5f5f5;
  --muted: #b7b7b7;
  --accent: #00d4aa;
  --accent-soft: rgba(0, 212, 170, 0.14);
  --danger: #d07070;
  --danger-soft: rgba(208, 112, 112, 0.14);
  --todo: #b59452;
  --todo-soft: rgba(181, 148, 82, 0.12);
  --reserved: #3fa97d;
  --reserved-soft: rgba(63, 169, 125, 0.14);
  --excluded: #a87945;
  --excluded-soft: rgba(168, 121, 69, 0.14);
  --uploaded: #a36d8f;
  --uploaded-soft: rgba(163, 109, 143, 0.14);
  --radius: 10px;
  --radius-sm: 8px;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.side-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.side-panel__inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.side-header h1,
.page-header h2,
.panel-block h2,
.task-section__header h3,
.task-title {
  margin: 0;
  font-weight: 700;
}

.side-header p,
.page-header p,
.field-note,
.plain-list,
.task-meta,
.summary-label,
.section-count,
.feedback,
.task-tmdb {
  color: var(--muted);
}

.side-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-header p,
.page-header p {
  margin: 0;
  font-size: 14px;
}

.panel-block,
.task-section,
.summary-strip,
.selection-bar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel-block {
  padding: 18px;
}

.panel-block h2 {
  margin-bottom: 14px;
  font-size: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.bulk-input,
.text-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  padding: 12px 14px;
}

.bulk-input {
  min-height: 240px;
  resize: vertical;
}

.text-input {
  min-height: 44px;
}

.bulk-input:focus,
.text-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.button-row,
.toolbar,
.selection-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover {
  border-color: #5b5b5b;
}

.button:disabled {
  cursor: not-allowed;
  color: #7c7c7c;
  border-color: #3d3d3d;
  background: transparent;
}

.button--primary {
  background: var(--accent-soft);
  border-color: rgba(0, 212, 170, 0.42);
}

.button--primary:hover {
  background: rgba(0, 212, 170, 0.22);
}

.button--secondary,
.button--ghost {
  background: transparent;
}

.button--ghost {
  color: var(--muted);
}

.button--danger {
  border-color: rgba(208, 112, 112, 0.46);
  background: var(--danger-soft);
  color: #e9c2c2;
}

.button--danger:hover {
  border-color: rgba(208, 112, 112, 0.68);
}

.feedback {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
}

.feedback.is-success {
  color: var(--accent);
}

.feedback.is-error {
  color: var(--danger);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.plain-list li + li {
  margin-top: 8px;
}

.main-panel {
  padding: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.search-field {
  min-width: 260px;
}

.language-switch {
  display: flex;
  gap: 0;
}

.language-button {
  min-height: 44px;
  min-width: 88px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.language-button + .language-button {
  border-left: 0;
}

.language-button:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.language-button:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.language-button:hover {
  color: var(--text);
}

.language-button.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 20px;
  overflow: hidden;
}

.summary-cell,
.selection-bar {
  padding: 16px 18px;
}

.summary-cell + .summary-cell {
  border-left: 1px solid var(--border);
}

.summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.summary-cell strong,
.selection-meta strong {
  font-size: 22px;
}

.selection-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.selection-meta {
  min-width: 140px;
}

.selection-actions {
  flex-wrap: wrap;
}

.board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.task-section--full {
  grid-column: 1 / -1;
}

.task-section__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.section-count {
  font-size: 13px;
}

.task-list:empty::before {
  content: attr(data-empty);
  display: block;
  padding: 18px;
  color: var(--muted);
}

.task-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.task-item + .task-item {
  border-top: 1px solid var(--border);
}

.task-item__primary {
  min-width: 0;
  display: flex;
  gap: 14px;
  flex: 1;
  align-items: flex-start;
}

.task-select {
  display: flex;
  align-items: center;
  padding-top: 2px;
}

.select-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.task-time {
  flex: 0 0 112px;
  color: var(--accent);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.task-content {
  min-width: 0;
}

.task-title {
  margin-bottom: 8px;
  font-size: 16px;
}

.task-meta,
.task-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 13px;
}

.task-links {
  margin-top: 10px;
}

.task-link {
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(245, 245, 245, 0.28);
}

.task-link:hover {
  border-bottom-color: rgba(245, 245, 245, 0.7);
}

.task-link.is-disabled {
  pointer-events: none;
  border-bottom-color: transparent;
  color: var(--muted);
}

.task-item__controls {
  flex: 0 0 196px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-button-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-button {
  min-height: 38px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.status-button:hover {
  color: var(--text);
}

.status-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.12);
  outline-offset: 1px;
}

.status-button[data-status="todo"] {
  border-color: rgba(181, 148, 82, 0.48);
  color: #d8bf88;
  background: var(--todo-soft);
}

.status-button[data-status="reserved"] {
  border-color: rgba(63, 169, 125, 0.48);
  color: #94d2b7;
  background: var(--reserved-soft);
}

.status-button[data-status="excluded"] {
  border-color: rgba(168, 121, 69, 0.48);
  color: #d3aa80;
  background: var(--excluded-soft);
}

.status-button[data-status="uploaded"] {
  border-color: rgba(163, 109, 143, 0.48);
  color: #d1aac3;
  background: var(--uploaded-soft);
}

.status-button[data-status="todo"].is-active {
  border-color: var(--todo);
  background: rgba(181, 148, 82, 0.24);
  color: #f0ddae;
}

.status-button[data-status="reserved"].is-active {
  border-color: var(--reserved);
  background: rgba(63, 169, 125, 0.26);
  color: #d4f1e4;
}

.status-button[data-status="excluded"].is-active {
  border-color: var(--excluded);
  background: rgba(168, 121, 69, 0.26);
  color: #f0d1b2;
}

.status-button[data-status="uploaded"].is-active {
  border-color: var(--uploaded);
  background: rgba(163, 109, 143, 0.26);
  color: #f0d4e5;
}

.is-hidden {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

@media (max-width: 720px) {
  .main-panel,
  .side-panel__inner {
    padding: 16px;
  }

  .page-header,
  .toolbar,
  .task-item,
  .task-item__primary,
  .selection-bar {
    flex-direction: column;
  }

  .toolbar,
  .search-field,
  .language-switch,
  .selection-actions {
    width: 100%;
  }

  .language-button,
  .selection-actions .button {
    flex: 1 1 0;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-cell:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .summary-cell:nth-child(4),
  .summary-cell:nth-child(5) {
    border-top: 1px solid var(--border);
  }

  .task-time,
  .task-item__controls,
  .selection-meta {
    flex: 1 1 auto;
    width: 100%;
  }
}