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

:root {
  --ink: #1c2922;
  --muted: #6c7770;
  --green: #315b43;
  --green-dark: #203d2d;
  --cream: #f5f3ed;
  --line: #e5e6df;
  --white: #fff;
  --gold: #c69a54;
  --shadow: 0 18px 50px rgba(27, 42, 32, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--cream);
  font-family: "Cairo", Tahoma, sans-serif; min-height: 100vh;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar {
  height: 78px; padding: 0 clamp(18px, 5vw, 72px); display: flex;
  justify-content: space-between; align-items: center; background: #17221d; color: white;
}
.brand { display:flex; align-items:center; gap:12px; color:inherit; text-decoration:none; }
.brand-mark {
  display:grid; place-items:center; width:42px; height:42px; border-radius:13px;
  color:#17221d; background:var(--gold); font-weight:800; font-size:23px;
}
.brand strong { display:block; font-size:19px; line-height:1.2; }
.brand small { display:block; color:#c3ccc5; font-size:11px; }
.top-actions { display:flex; align-items:center; gap:14px; }
.user-email { color:#d6dfd8; font-size:13px; }
.page { width:min(1120px, calc(100% - 36px)); margin:42px auto 64px; min-height:calc(100vh - 190px); }
.auth-layout { display:grid; grid-template-columns:1.1fr .9fr; gap: clamp(28px, 6vw, 82px); align-items:center; min-height:570px; }
.intro-panel { padding:20px 0; }
.eyebrow { color:var(--gold); font-weight:800; font-size:12px; letter-spacing:.4px; }
h1 { margin:10px 0 14px; font-size:clamp(32px, 4.3vw, 52px); line-height:1.35; }
.intro-panel h1 { color:var(--green-dark); }
.intro-panel h1 em { color:var(--gold); font-style:normal; }
.intro-panel p { max-width:520px; color:var(--muted); font-size:16px; line-height:2; }
.feature-pills { display:flex; flex-wrap:wrap; gap:9px; margin-top:25px; }
.feature-pills span { padding:8px 13px; border:1px solid #dfe2d9; border-radius:99px; color:var(--green); background:#fbfaf6; font-size:12px; }
.auth-card, .editor-card {
  background:var(--white); border:1px solid var(--line); border-radius:22px;
  box-shadow:var(--shadow); padding:clamp(20px, 3vw, 34px);
}
.auth-card { max-width:470px; width:100%; justify-self:end; }
.tabs { display:grid; grid-template-columns:1fr 1fr; gap:5px; background:#f2f3ef; padding:5px; border-radius:12px; margin-bottom:25px; }
.tab { border:0; background:transparent; color:var(--muted); border-radius:9px; padding:10px; font-weight:700; }
.tab.active { background:white; color:var(--green-dark); box-shadow:0 2px 8px #17221d12; }
.form-stack { display:grid; gap:16px; }
label { display:grid; gap:7px; color:#3c4941; font-weight:700; font-size:13px; }
input, textarea {
  width:100%; border:1px solid #dfe3dc; background:#fff; border-radius:10px;
  padding:12px 13px; color:var(--ink); outline:none; transition:.2s;
}
input:focus, textarea:focus { border-color:#6b9277; box-shadow:0 0 0 3px #315b4314; }
textarea { resize:vertical; }
.button { border:0; border-radius:10px; padding:11px 18px; font-weight:800; transition:.18s; }
.button-primary { background:var(--green); color:white; }
.button-primary:hover { background:var(--green-dark); transform:translateY(-1px); }
.workspace-action {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  min-height:52px;
  min-width:min(100%, 170px);
  font-family:inherit;
  font-size:1rem;
  font-weight:800;
  line-height:1.4;
  text-decoration:none;
  text-align:center;
}

#workspace-view label {
  color:#244638;
  font-size:1rem;
}

#workspace-view :is(input:not([type="hidden"]), select, textarea) {
  min-height:46px;
  border-color:#829a8c;
  background:#fff;
  color:#18372b;
  font:inherit;
  font-size:1.0625rem;
}

#workspace-view select { background:#edf5ef; }
.button-light { background:#eef1ec; color:var(--green-dark); }
.button-ghost { border:1px solid #637269; background:transparent; color:white; padding:8px 13px; font-size:12px; }
.text-button { border:0; background:none; color:var(--green); justify-self:center; font-size:12px; font-weight:700; padding:3px; }
.fine-print, .muted { color:var(--muted); font-size:13px; line-height:1.9; }
.fine-print { border-top:1px solid var(--line); padding-top:13px; margin:18px 0 0; font-size:11px; }
.message { min-height:22px; font-size:13px; color:var(--green); margin:8px 0; }
.message.error { color:#b44435; }
.notice { padding:15px 18px; border-radius:12px; margin-bottom:22px; font-size:13px; line-height:1.8; }
.notice p { margin:5px 0 0; }
.notice-info { background:#edf3ee; border:1px solid #d5e4d8; color:#294d36; }
code { direction:ltr; display:inline-block; background:#e1e9e2; padding:1px 5px; border-radius:4px; }
.workspace-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:end; gap:20px; margin-bottom:26px; }
.workspace-heading h1 { font-size:38px; margin:4px 0; }
.workspace-welcome {
  width:100%;
  margin:0 auto 30px;
  min-height:420px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:24px;
  text-align:center;
  background:#e8ddcc url("/images/workspace-workshop.jpg") no-repeat right 24% / cover;
  border:1px solid #c9b38c;
  border-radius:20px;
}
.workspace-welcome-copy {
  padding:18px 24px;
  max-width:100%;
  background:#faf7ef;
  border:1px solid #c9b38c;
  border-radius:15px;
}
@media (max-width:640px) {
  .workspace-welcome {
    min-height:0;
    aspect-ratio:4/3;
    align-items:flex-end;
    justify-content:center;
    padding:12px;
    background-position:62% top;
  }
  .workspace-welcome-copy { padding:8px 14px; }
}
.workspace-welcome-title {
  margin:0;
  color:#285340;
  font-size:clamp(1.45rem, 4vw, 2rem);
  font-weight:800;
}
.workspace-welcome-prompt {
  margin:8px 0 0;
  color:#795529;
  font-size:1rem;
  font-weight:700;
}
.workspace-heading p { margin:0; }
.editor-card { margin-bottom:25px; }
.editor-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.editor-heading h2 { margin:3px 0 0; font-size:22px; }
.icon-button { width:36px; height:36px; border:0; border-radius:50%; background:#e5efe8; color:#315b47; }
.button:focus-visible, .icon-button:focus-visible, .auth-tab:focus-visible {
  outline:2px solid #35644d;
  outline-offset:3px;
}
.editor-actions { display:flex; gap:9px; }
.kitchen-unit { min-width:0; margin:0; padding:16px; border:1px solid #d9dfd7; border-radius:12px; }
.kitchen-unit-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr)); gap:12px; margin-bottom:12px; }
.kitchen-unit select { width:100%; min-height:44px; font:inherit; padding:8px; border:1px solid #d9dfd7; border-radius:8px; background:#fff; color:inherit; }
.projects-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:17px; }
.project-card { background:white; border:1px solid var(--line); border-radius:17px; padding:20px; box-shadow:0 8px 25px #17221d08; }
.project-card h3 { margin:0 0 7px; font-size:17px; overflow-wrap:anywhere; }
.project-card p { color:var(--muted); font-size:12px; line-height:1.8; min-height:43px; white-space:pre-wrap; overflow-wrap:anywhere; }
.project-meta { color:#89938b; font-size:10px; margin:12px 0; }
.card-actions { display:flex; gap:8px; padding-top:12px; border-top:1px solid var(--line); }
.card-actions button { flex:1; font-size:11px; padding:8px 10px; }
.delete-button { background:#fff1ef; color:#a34035; }
.empty-state { text-align:center; background:#fff; border:1px dashed #cbd4ca; border-radius:18px; padding:40px 20px 48px; }
.empty-icon { font-size:40px; color:var(--gold); }
.empty-state h2 { margin:4px 0 8px; }
.empty-state p { color:var(--muted); font-size:13px; }
.footer { display:flex; justify-content:space-between; gap:12px; padding:18px clamp(18px, 5vw, 72px); color:#849087; font-size:11px; border-top:1px solid #e5e6df; }
@media (max-width:850px) {
  .auth-layout { grid-template-columns:1fr; gap:20px; min-height:auto; }
  .intro-panel { padding:0; }
  .intro-panel h1 { font-size:36px; }
  .auth-card { justify-self:stretch; max-width:none; }
  .projects-grid { grid-template-columns:repeat(2, 1fr); }
}
@media (max-width:560px) {
  .topbar { height:68px; padding:0 15px; }
  .brand-mark { width:37px; height:37px; }
  .user-email { display:none; }
  .page { margin:25px auto 42px; width:calc(100% - 28px); }
  .intro-panel h1 { font-size:30px; }
  .intro-panel p { font-size:13px; }
  .workspace-heading { align-items:start; flex-direction:column; }
  .workspace-heading h1 { font-size:32px; }
  .projects-grid { grid-template-columns:1fr; }
  .footer { flex-direction:column; text-align:center; }
}
.project-tools {
  display:grid;
  grid-template-columns:minmax(0, 2fr) minmax(0, 1fr);
  gap:14px;
}
.project-tools select {
  width:100%;
  padding:10px 13px;
  border:1px solid #829a8c;
  border-radius:10px;
}
.project-tools select:focus { outline:2px solid #35644d; outline-offset:2px; }
.projects-grid .project-card { border-top:3px solid #527762; }
.projects-grid .project-card:hover { border-color:#527762; }
@media(max-width:600px) { .project-tools { grid-template-columns:1fr; } }

.analytics-panel { margin:0 0 24px; padding:16px; border:1px solid #c4d5c8; border-radius:14px; background:#fff; }
.analytics-panel summary { color:#244b39; font-size:1.05rem; font-weight:800; cursor:pointer; }
.analytics-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:12px; }
.analytics-grid > div { padding:12px; border-radius:10px; background:#eef5ef; }
.analytics-grid dd { margin:6px 0 0; color:#244b39; font-size:1.5rem; font-weight:800; }
