:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #20242d;
  --muted: #6f7885;
  --line: #d9dee8;
  --accent: #0a46ff;
  --accent-strong: #1227df;
  --accent-soft: #e9f0ff;
  --page: #ffffff;
  --shadow: 0 18px 50px rgba(28, 42, 78, 0.08);
  --shadow-soft: 0 8px 24px rgba(28, 42, 78, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #edf1f6 0%, #e6ebf3 100%);
}

@media (min-width: 961px) {
  body.editor-scroll-locked {
    height: 100vh;
    overflow: hidden;
  }
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.app-shell-editor {
  padding: 0;
  background: #edf1f5;
  height: 100vh;
  overflow: hidden;
}

.view {
  max-width: 1440px;
  margin: 0 auto;
}

.topbar,
.card,
.panel,
.page {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.page-header h1,
.page-header h2,
.page-header h3,
.section-title {
  margin: 0;
}

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

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

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
}

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #cfdcff;
}

.card {
  padding: 18px;
  border-radius: 16px;
}

.card h3 {
  margin: 0 0 8px;
}

.card-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 12px;
}

.create-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.list-create-layout {
  margin-bottom: 20px;
}

.panel {
  border-radius: 28px;
  padding: 24px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.editor-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-width: none;
  height: 100vh;
  min-height: 100vh;
  gap: 0;
  min-width: 0;
}

.topbar {
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-title {
  display: grid;
  gap: 6px;
}

.topbar-title strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar-title .muted {
  font-size: 13px;
}

.topbar-leading {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  min-width: 0;
}

.editor-chrome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid #e5eaf3;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 30;
}

.editor-back-button {
  min-width: 72px;
  min-height: 72px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 700;
}

.editor-chrome-actions {
  justify-self: end;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.editor-header-status {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.editor-header-button {
  min-height: 50px;
  min-width: 148px;
  padding-inline: 22px;
  font-weight: 700;
  border-radius: 12px;
}

.editor-workspace {
  display: grid;
  gap: 0;
  align-items: stretch;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.editor-workspace-edit {
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, 0.92fr);
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.editor-workspace-preview {
  grid-template-columns: minmax(0, 1fr);
}

.editor-workspace-preview .editor-preview-panel {
  max-width: 980px;
  width: 100%;
  justify-self: center;
}

.editor-form-panel {
  display: grid;
  gap: 28px;
  padding: 28px 32px 72px;
  background: #fff;
  border: 0;
  border-right: 1px solid #e5eaf3;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.editor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 16px;
  background: inherit;
}

.editor-panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.editor-form-panel > section,
.editor-form-panel > .section-block {
  margin: 0;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid #eceff5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.editor-form-panel > section:first-of-type,
.editor-form-panel > .section-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.editor-form-panel .section-block {
  border-top: 1px solid #eceff5;
}

.editor-form-panel h2,
.editor-form-panel h3 {
  font-size: 16px;
}

.editor-preview-panel {
  padding: 18px 24px 72px;
  background: #edf1f5;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.resume-list-panel {
  padding: 0;
  overflow: hidden;
}

.resume-list-head,
.resume-list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1.2fr) minmax(180px, 1fr) 160px 180px;
  gap: 0;
  align-items: center;
}

.resume-list-head {
  padding: 16px 20px;
  background: #f4f7fb;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.resume-list-row {
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f6;
}

.resume-list-row:last-child {
  border-bottom: 0;
}

.resume-list-cell {
  padding-right: 12px;
}

.list-cell-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.resume-list-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
}

.resume-list-input:focus {
  background: #fff;
  border-color: #bfd0fb;
  outline: none;
}

.resume-list-updated {
  color: var(--muted);
  font-size: 14px;
}

.resume-list-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.form-panel,
.preview-panel {
  min-height: calc(100vh - 180px);
}

.section-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.editor-form-panel > .section-block {
  margin-top: 0;
  padding-top: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-card {
  border: 1px solid #e1e7f0;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  margin-bottom: 14px;
}

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

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

.preview-pages {
  display: grid;
  gap: 32px;
  justify-items: center;
}

.page {
  width: min(210mm, 100%);
  max-width: 100%;
  min-height: 297mm;
  margin: 0 auto;
  padding: 14mm 14mm 16mm;
  background: var(--page);
  border: 1px solid #e2e8f0;
  border-radius: 0;
  color: #111;
  font-family:
    "Hiragino Mincho ProN",
    "Yu Mincho",
    "Times New Roman",
    serif;
  font-size: 12px;
  line-height: 1.65;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.page h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.page h3 {
  margin: 16px 0 6px;
  font-size: 13px;
  border-bottom: 1px solid #888;
  padding-bottom: 2px;
}

.preview-doc-meta {
  margin-bottom: 6px;
  color: #444;
  font-size: 11px;
  text-align: right;
}

.preview-doc-name {
  font-size: 12px;
  text-align: right;
}

.plain-block {
  white-space: pre-wrap;
}

.resume-doc-heading,
.career-doc-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.resume-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.resume-name ruby rt {
  font-size: 9px;
  letter-spacing: 0.04em;
}

.resume-name-gap {
  display: inline-block;
  width: 0.7em;
}

.resume-header-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36mm;
  column-gap: 12px;
  row-gap: 6px;
  align-items: start;
  margin-bottom: 8px;
}

.resume-doc-heading {
  grid-column: 1;
  grid-row: 1;
}

.resume-name-block {
  grid-column: 1;
  grid-row: 2;
}

.resume-profile-list {
  display: grid;
  gap: 4px;
}

.resume-profile-row {
  min-height: 1.8em;
}

.resume-photo-slot {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 30mm;
  min-height: 40mm;
  justify-self: end;
  border: 1px solid #777;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 4mm 2mm;
  color: #444;
  text-align: center;
}

.resume-photo-slot-label {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.resume-photo-slot-size {
  font-size: 9px;
}

.timeline-list,
.bullet-list {
  margin: 0;
  padding-left: 20px;
}

.experience-block {
  margin-bottom: 14px;
}

.project-block {
  border-left: 1px solid #999;
  padding-left: 10px;
  margin: 10px 0 12px;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: transparent;
  color: #111;
  border: 1px solid #999;
  border-radius: 0;
  padding: 2px 6px;
  font-size: 11px;
}

.skill-line {
  margin-top: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f6fb;
  color: #4d5d77;
  border: 1px solid #dbe3f2;
  font-size: 13px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .create-layout {
    grid-template-columns: 1fr;
  }

  .app-shell-editor {
    padding: 16px;
    height: auto;
    overflow: visible;
  }

  .editor-layout {
    height: auto;
    min-height: 0;
    gap: 16px;
  }

  .editor-chrome {
    grid-template-columns: 1fr;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    position: static;
  }

  .editor-chrome-actions {
    justify-self: start;
  }

  .editor-header-status {
    justify-items: start;
  }

  .editor-workspace-edit {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .editor-form-panel,
  .editor-preview-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    height: auto;
    overflow: visible;
  }

  .editor-form-panel {
    padding: 24px;
    border-right: 1px solid var(--line);
  }

  .editor-preview-panel {
    padding: 20px;
    background: #e3e9f2;
  }

  .editor-panel-header {
    position: static;
    padding-bottom: 0;
  }

  .resume-list-head {
    display: none;
  }

  .resume-list-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .page {
    width: 100%;
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 16px;
  }

  .topbar-title strong {
    font-size: 22px;
  }

  .editor-chrome-actions {
    width: 100%;
  }

  .editor-header-button {
    flex: 1 1 180px;
    min-width: 0;
  }

  .inline-grid,
  .triple-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 18px;
  }

  .editor-form-panel > section,
  .editor-form-panel > .section-block,
  .editor-preview-panel {
    padding: 18px;
  }

  .topbar-leading {
    align-items: flex-start;
  }

  .editor-back-button {
    min-height: 56px;
    min-width: auto;
    border-radius: 18px;
  }

  .editor-form-panel {
    padding: 18px;
  }
}

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

  .app-shell {
    padding: 0;
  }

  .topbar,
  .editor-chrome,
  .form-panel,
  .page-header,
  .create-layout,
  .card,
  .panel:not(.preview-panel) {
    display: none !important;
  }

  .editor-body {
    display: block;
  }

  .preview-panel {
    position: static;
    min-height: auto;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .page {
    width: 210mm;
    min-height: 297mm;
    padding: 18mm 16mm;
    border: 0;
    box-shadow: none;
    margin: 0;
    page-break-after: always;
  }

  .page:last-child {
    page-break-after: auto;
  }

}
