:root {
  color-scheme: light;
  --bg: #f7f5f1;
  --panel: #fffdf9;
  --panel-2: #f1efea;
  --text: #171717;
  --muted: #69635d;
  --line: #ded8cf;
  --brand: #ff6a00;
  --brand-soft: #fff0e4;
  --blue: #3975c8;
  --green: #527a50;
  --cosmos: #252b35;
  --coral: #d66557;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(23, 23, 23, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

a {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.82);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--brand-soft);
  border: 1px solid rgba(255, 106, 0, 0.22);
}

.brand-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.nav-group {
  margin: 20px 0;
}

.nav-heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--brand-soft);
}

.nav-link strong {
  font-size: 13px;
}

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

.content {
  width: min(1180px, 100%);
  padding: 34px 40px 56px;
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: 0;
}

h2 {
  margin: 32px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 24px 0 10px;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.65;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  background: rgba(255, 253, 249, 0.7);
}

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

.summary-card,
.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.summary-card strong,
.card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.summary-card span,
.card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.project-card strong,
.project-heading,
.project-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-heading {
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 15px;
}

.project-label {
  min-width: 160px;
  font-weight: 650;
  color: var(--text);
}

.project-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  object-fit: cover;
  padding: 0;
  border: 1px solid rgba(222, 216, 207, 0.9);
  background: var(--panel);
  box-sizing: border-box;
}

.project-icon[src*="snapworks-mark-imagegen2-smooth"] {
  object-fit: contain;
  padding: 4px;
  background: #fffaf4;
}

.project-icon.flat {
  padding: 0;
  border: 0;
  background: transparent;
}

.callout {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255, 106, 0, 0.26);
  border-radius: var(--radius);
  background: var(--brand-soft);
}

.callout p {
  color: #5a3822;
}

.section {
  margin: 28px 0;
  padding-top: 8px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.55;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-2);
}

tr:last-child td {
  border-bottom: 0;
}

code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: #2d2b28;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.tag.public {
  border-color: rgba(57, 117, 200, 0.25);
  color: var(--blue);
}

.tag.candidate {
  border-color: rgba(82, 122, 80, 0.25);
  color: var(--green);
}

.tag.risk {
  border-color: rgba(214, 101, 87, 0.28);
  color: var(--coral);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-header h2 {
  margin-top: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.72);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-status[data-mode="json"] {
  border-color: rgba(82, 122, 80, 0.28);
  color: var(--green);
}

.save-status[data-mode="saving"] {
  border-color: rgba(255, 106, 0, 0.28);
  color: var(--brand);
}

.save-status[data-mode="error"] {
  border-color: rgba(214, 101, 87, 0.34);
  color: var(--coral);
}

.soft-button,
.icon-button,
.status-select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.soft-button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.soft-button:hover,
.icon-button:hover:not(:disabled),
.status-select:hover {
  border-color: rgba(255, 106, 0, 0.34);
  background: var(--brand-soft);
}

.app-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.app-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.58);
}

.app-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  margin-bottom: 10px;
}

.app-column-header h3 {
  margin: 0;
  font-size: 14px;
}

.app-count {
  min-width: 24px;
  height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.app-list {
  display: grid;
  gap: 10px;
}

.app-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.app-item-main {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.app-copy {
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.app-title-row strong {
  font-size: 13px;
}

.app-path {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.app-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 106, 0, 0.24);
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: #5a3822;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.app-link:hover {
  border-color: rgba(255, 106, 0, 0.42);
  color: var(--text);
}

.app-link-meta {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
}

.app-controls {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr);
  gap: 7px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.icon-button:disabled {
  opacity: 0.38;
}

.status-select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.list {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.list li {
  margin: 5px 0;
}

.footer {
  margin-top: 42px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.template-box {
  padding: 14px;
  border: 1px dashed #c8c0b6;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.6);
}

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

.field {
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.field b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 24px 18px 42px;
  }

  .topline {
    display: block;
  }

  .meta {
    margin-top: 14px;
    white-space: normal;
  }

  h1 {
    font-size: 28px;
  }

  .summary-grid,
  .card-grid,
  .field-grid,
  .app-board {
    grid-template-columns: 1fr;
  }

  .section-header {
    display: block;
  }

  .section-actions {
    justify-content: flex-start;
    margin-top: 10px;
  }

  table {
    min-width: 640px;
  }
}

body.landing-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(247, 245, 241, 0.98)),
    var(--bg);
}

.link-landing {
  width: min(100%, 520px);
  margin: 0 auto;
}

.link-profile {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 22px;
  text-align: center;
}

.link-profile-mark {
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 106, 0, 0.22);
  border-radius: 18px;
  background: var(--brand-soft);
  object-fit: contain;
  padding: 8px;
  box-shadow: 0 14px 30px rgba(23, 23, 23, 0.08);
}

.link-profile h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.12;
  text-align: center;
}

.link-intro {
  max-width: 360px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.link-intro span {
  display: block;
}

.link-intro span + span,
.link-button small span + span {
  margin-top: 2px;
}

.link-stack {
  display: grid;
  gap: 10px;
}

.link-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(23, 23, 23, 0.06);
}

.link-button:hover {
  border-color: rgba(255, 106, 0, 0.32);
  background: #fffaf4;
  transform: translateY(-1px);
}

.link-button img {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(222, 216, 207, 0.9);
  border-radius: 11px;
  background: var(--panel);
  object-fit: cover;
}

.link-button img.github-project-icon,
.project-icon[src*="github.svg"] {
  object-fit: contain;
  padding: 10px;
  background: #ffffff;
}

.link-button strong,
.link-button small {
  display: block;
  min-width: 0;
}

.link-button strong {
  font-size: 15px;
  line-height: 1.25;
}

.link-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.link-button small span {
  display: block;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(222, 216, 207, 0.92);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.74);
  color: #3f3a35;
  text-decoration: none;
}

.social-links img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.social-links a:hover {
  border-color: rgba(255, 106, 0, 0.34);
  color: var(--text);
}

.landing-footer {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 520px) {
  body.landing-page {
    align-items: start;
    padding-top: 28px;
  }

  .link-profile h1 {
    font-size: 28px;
  }

  .link-button {
    min-height: 78px;
    border-radius: 12px;
  }
}
