@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --ink: #171914;
  --muted: #6d7068;
  --paper: #f6f4ed;
  --card: #fffefa;
  --line: #dfddd4;
  --acid: #d9f56e;
  --acid-dark: #bcd94d;
  --danger: #b84738;
  --shadow: 0 18px 60px rgba(31, 34, 25, .08);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: "DM Sans", sans-serif; background: radial-gradient(circle at 90% 10%, rgba(217,245,110,.18), transparent 24rem), var(--paper); min-height: 100vh; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
.topbar { height: 76px; padding: 0 max(24px, calc((100vw - 1180px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(246,244,237,.86); backdrop-filter: blur(15px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; font: 800 20px "Manrope", sans-serif; }
.brand small { color: var(--muted); font-size: 11px; vertical-align: top; }
.brand-mark, .login-logo { display: grid; place-items: center; background: var(--ink); color: var(--acid); font: 800 18px "Manrope"; border-radius: 9px 3px 9px 3px; transform: rotate(-2deg); }
.brand-mark { width: 36px; height: 36px; }
.topbar nav { display: flex; align-items: center; gap: 24px; }
.topbar nav a, .link-button { color: #4f514b; text-decoration: none; font-weight: 600; font-size: 14px; }
.topbar nav form { margin: 0; }
.link-button { border: 0; background: none; cursor: pointer; padding: 0; }
.page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 68px 0 90px; }
.eyebrow { letter-spacing: .16em; font-size: 11px; font-weight: 800; margin: 0 0 10px; color: #677336; }
h1, h2, h3 { font-family: "Manrope", sans-serif; }
h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.02; letter-spacing: -.05em; margin: 0; }
.muted { color: var(--muted); }
.hero-row { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 42px; }
.hero-row h1 + .muted { margin: 14px 0 0; }
.hero-row.compact { max-width: 800px; margin-bottom: 32px; }
.button { border: 1px solid var(--ink); background: var(--ink); color: white; border-radius: 11px; padding: 14px 21px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--acid-dark); transition: transform .15s, box-shadow .15s; }
.button:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--acid-dark); }
.button:disabled { opacity: .68; cursor: wait; }
.button.small { padding: 9px 14px; box-shadow: none; color: white; }
.button.wide { width: 100%; margin-top: 8px; }
.messages { margin-bottom: 24px; display: grid; gap: 8px; }
.message { border: 1px solid var(--line); padding: 12px 15px; border-radius: 9px; background: white; }
.message.error { border-color: #e2b5ae; background: #fff1ef; color: #8f2f24; }
.message.success { border-color: #cbdc8b; background: #f4fadf; color: #47591a; }
.project-grid { display: grid; gap: 12px; }
.project-card { min-height: 104px; display: flex; align-items: center; gap: 20px; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; transition: border .15s, transform .15s, box-shadow .15s; }
.project-card:hover { border-color: #aeb779; transform: translateY(-2px); box-shadow: var(--shadow); }
.project-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: var(--acid); font-size: 22px; }
.project-main { min-width: 0; flex: 1; }
.project-main h2 { font-size: 18px; margin: 0 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-main p { color: var(--muted); margin: 0; font-size: 13px; }
.role-pill { font-size: 10px; letter-spacing: .08em; border: 1px solid var(--line); padding: 5px 8px; border-radius: 20px; color: var(--muted); }
.arrow { font-size: 24px; color: #85877e; }
.empty-state { max-width: 600px; margin: 60px auto; text-align: center; padding: 60px 32px; border: 1px dashed #c6c3b7; border-radius: 18px; }
.empty-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); font-size: 30px; margin: 0 auto 20px; }
.empty-state h1, .empty-state h2 { font-size: 28px; letter-spacing: -.03em; }
.empty-state p { color: var(--muted); margin-bottom: 26px; }
.editor-card { background: var(--card); border: 1px solid var(--line); padding: clamp(24px, 5vw, 48px); border-radius: 18px; box-shadow: var(--shadow); }
.settings-section { margin-bottom: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.settings-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, .8fr); gap: 22px; }
.status-pill { border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill.connected { background: #edf7cb; color: #4d5e1e; border: 1px solid #c9dc87; }
.status-pill.disconnected { background: #fff0ed; color: #923b30; border: 1px solid #e1b3ac; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--danger); font-size: 13px; margin: -8px 0 26px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 0; }
.field { display: grid; gap: 9px; margin-bottom: 28px; }
.field label { font-weight: 700; font-size: 14px; }
.field label span { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid #c8c6bd; border-radius: 10px; padding: 13px 14px; background: #fff; color: var(--ink); outline: none; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #788633; box-shadow: 0 0 0 3px rgba(217,245,110,.45); }
.hint { color: var(--muted); font-size: 12px; }
.placeholder-help { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.placeholder-help code { background: var(--acid); color: #39430f; border-radius: 6px; padding: 4px 7px; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.form-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 26px; }
.text-link, .back-link { color: var(--muted); font-weight: 600; text-decoration: none; }
.loading-label { display: none; }
.generate.loading .normal-label { display: none; }
.generate.loading .loading-label { display: inline; }
.process-note { display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 25px; }
.process-note span { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #c7c5bb; border-radius: 50%; font-weight: 700; }
.process-note i { font-style: normal; color: #a5a69e; }
.detail-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 32px; }
.detail-actions { display: flex; align-items: center; gap: 9px; }
.detail-actions form { margin: 0; }
.back-link { display: inline-block; margin-bottom: 24px; font-size: 13px; }
.detail-head h1 { font-size: clamp(32px, 5vw, 52px); }
.secondary-button { border: 1px solid #b8b7ae; color: var(--ink); background: var(--card); padding: 9px 13px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.secondary-button:hover { border-color: #7d853f; background: #f8fce9; }
.danger-button { border: 1px solid #d9b4af; color: var(--danger); background: transparent; padding: 9px 13px; border-radius: 8px; cursor: pointer; }
.result-tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); }
.tab, .copy-button { border: 0; background: transparent; padding: 13px 18px; cursor: pointer; color: var(--muted); font-weight: 700; }
.tab.active { color: var(--ink); border-bottom: 3px solid var(--ink); }
.copy-button { margin-left: auto; color: #53631c; }
.result-panel { display: none; background: white; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; }
.result-panel.active { display: block; }
.preview-frame { width: 100%; min-height: 580px; border: 0; background: white; }
pre { margin: 0; padding: 28px; overflow: auto; min-height: 500px; background: #20221f; color: #ecf5cc; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.source-details { margin-top: 22px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.45); }
.source-details summary { padding: 16px 18px; cursor: pointer; font-weight: 700; }
.source-content { padding: 0 18px 18px; color: var(--muted); overflow-wrap: anywhere; }
.source-content a { color: #52641b; }
.input-editor { scroll-margin-top: 95px; }
.input-editor-form { padding: 10px 22px 24px; border-top: 1px solid var(--line); }
.input-editor-form .field:first-of-type { margin-top: 22px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 0; }
.login-card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); padding: clamp(32px, 7vw, 54px); border-radius: 20px; box-shadow: var(--shadow); }
.login-logo { width: 54px; height: 54px; font-size: 26px; margin-bottom: 28px; }
.login-card h1 { font-size: clamp(38px, 9vw, 54px); margin-bottom: 18px; }
.login-card > .muted { line-height: 1.6; margin-bottom: 30px; }
.stacked-form { display: grid; gap: 9px; }
.stacked-form label { font-size: 13px; font-weight: 700; }
.password-row { position: relative; }
.password-row input { padding-right: 48px; }
.icon-button { position: absolute; right: 6px; top: 6px; bottom: 6px; width: 38px; border: 0; background: transparent; cursor: pointer; opacity: .65; }
.login-foot { margin: 28px 0 0; text-align: center; font-size: 11px; color: #96988e; }

@media (max-width: 720px) {
  .topbar { padding: 0 18px; height: 66px; }
  .topbar nav { gap: 12px; }
  .topbar nav > a:first-child, .topbar nav .link-button { display: none; }
  .page { width: min(100% - 28px, 1180px); padding-top: 42px; }
  .hero-row { align-items: stretch; flex-direction: column; }
  .hero-row .button { align-self: flex-start; }
  .project-card { padding: 18px; gap: 14px; }
  .role-pill { display: none; }
  .detail-head { align-items: flex-start; flex-direction: column; }
  .editor-card { padding: 24px 18px; }
  .settings-columns { grid-template-columns: 1fr; gap: 0; }
  .section-heading { align-items: flex-start; }
  .form-footer { gap: 20px; }
  .process-note { display: none; }
}
