@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Work+Sans:wght@400;500&display=swap');
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --bg:#faf9f7;
  --surface:#fff;
  --text:#1a1a1a;
  --text-muted:#6b6b6b;
  --accent:#e85d04;
  --accent-hover:#c44e03;
  --border:#e0ddd8;
  --check-bg:#f0ede8;
  --error-bg:#fef2f2;
  --error-text:#991b1b;
  --ai-badge:#7c3aed;
  --radius:8px;
  --max-w:680px;
}

html{font-size:16px;-webkit-font-smoothing:antialiased}

body{
  font-family:'Work Sans',Georgia,"Times New Roman",serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
a[target="_blank"]::after{content:" ⤴";font-size:0.85em;color:var(--text-muted)}
a[target="_blank"]:hover::after{color:var(--accent)}
a.no-ext::after{content:none}

nav{
  max-width:var(--max-w);
  margin:0 auto;
  padding:1.25rem 1.5rem;
  width:100%;
  box-sizing:border-box;
}
nav a.wordmark{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:1.6rem;
  font-weight:800;
  color:var(--accent);
  letter-spacing:-0.03em;
  text-decoration:none;
}
nav a.wordmark:hover{text-decoration:none}

.page{
  max-width:var(--max-w);
  margin:0 auto;
  padding:0 1.5rem 2rem;
  flex:1;
  width:100%;
}

footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:1.25rem 1.5rem;
  color:var(--text-muted);
  font-size:0.8rem;
  font-family:'Poppins',system-ui,sans-serif;
  border-top:1px solid var(--border);
  margin-top:auto;
  width:100%;
  box-sizing:border-box;
}
footer a{color:var(--text-muted)}
footer a:hover{color:var(--accent)}
.commit-link{font-size:0.75rem}

.hero h1{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:3.75rem;
  line-height:1.1;
  letter-spacing:-0.03125em;
  font-weight:700;
}
.hero{text-align:center;padding:2.5rem 0 1rem}
.hero p{color:var(--text-muted);font-size:1.05rem;margin-bottom:0.5rem}
.userscript-hint{color:var(--text-muted);font-size:0.85rem;margin-top:0.5rem;font-family:'Poppins',system-ui,sans-serif}
.userscript-hint a{color:var(--accent)}

.search-form{}
.search-form form{display:flex;gap:0.5rem}
.search-form input[type="text"]{
  flex:1;
  padding:0.85rem 1.1rem;
  border:2px solid var(--border);
  border-radius:var(--radius);
  font-size:1.05rem;
  font-family:inherit;
  background:var(--surface);
  outline:none;
  transition:border-color 0.2s,box-shadow 0.2s;
}
.search-form input[type="text"]:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(232,93,4,0.1);
}
.search-form button{
  padding:0.85rem 1.6rem;
  background:var(--accent);
  color:#fff;
  border:none;
  border-radius:var(--radius);
  font-size:1.05rem;
  font-family:'Poppins',system-ui,sans-serif;
  font-weight:600;
  cursor:pointer;
  transition:background 0.2s;
}
.search-form button:hover{background:var(--accent-hover)}

.recipe-image-wrapper{
  margin-bottom:1.5rem;
}
.recipe-image{
  width:100%;
  max-height:400px;
  object-fit:cover;
  border-radius:var(--radius);
}
.recipe-source{
  text-align:right;
  font-size:0.8rem;
  margin-top:0.35rem;
  font-family:'Poppins',system-ui,sans-serif;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.recipe-source a svg{
  margin-right:0.25rem;
  vertical-align:middle;
}
.recipe-source a{
  color:var(--text);
  text-decoration:none;
}
.recipe-source a:hover{
  color:var(--accent);
  text-decoration:underline;
}
.recipe-source a:hover .source-path{
  color:var(--accent);
}
.source-path{
  color:var(--text-muted);
}

.recipe-header{margin-bottom:1.5rem}
.recipe-header h2{font-size:2rem;line-height:1.3;letter-spacing:0;font-weight:600;margin-bottom:0.35rem}
.recipe-meta{color:var(--text-muted);font-size:0.9rem;max-width:100%;overflow-wrap:break-word}
.recipe-meta span{margin-right:1rem}
.description{margin-top:0.5rem;color:var(--text-muted);font-size:0.95rem}

.extraction-badge{
  display:inline-block;
  padding:0.15rem 0.5rem;
  border-radius:4px;
  font-size:0.75rem;
  font-family:'Poppins',system-ui,sans-serif;
  vertical-align:middle;
}
.extraction-badge.schema{background:#dbeafe;color:#1e40af}
.extraction-badge.hrecipe{background:#d1fae5;color:#065f46}
.extraction-badge.ai{background:#ede9fe;color:var(--ai-badge)}

.section{margin-bottom:2rem}
.section h3{
  font-size:0.85rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--text-muted);
  border-bottom:2px solid var(--border);
  padding-bottom:0.35rem;
  margin-bottom:0.75rem;
  font-family:'Poppins',system-ui,sans-serif;
}

.ingredient-list{list-style:none}
.ingredient-list li{
  display:flex;
  align-items:flex-start;
  gap:0.6rem;
  padding:0.35rem 0;
  cursor:pointer;
  transition:opacity 0.2s;
}
.ingredient-list li.checked{opacity:0.45;text-decoration:line-through}
.ingredient-list li input[type="checkbox"]{
  width:1.1rem;height:1.1rem;
  accent-color:var(--accent);
  margin-top:0.3rem;
  flex-shrink:0;
}
.ingredient-list li label{cursor:pointer;flex:1}
.ingredient-group{
  font-size:0.8rem;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text-muted);
  margin:1rem 0 0.25rem;
  font-family:'Poppins',system-ui,sans-serif;
  font-weight:600;
}

.instruction-list{counter-reset:step;list-style:none}
.instruction-list li{
  counter-increment:step;
  position:relative;
  padding-left:2rem;
  margin-bottom:1.25rem;
}
.instruction-list li::before{
  content:counter(step) ".";
  position:absolute;
  left:0;top:0;
  color:var(--text-muted);
  font-size:0.85rem;
  font-family:'Poppins',system-ui,sans-serif;
  font-weight:600;
}

.timer-widget{
  padding:1rem 1.25rem;
  background:var(--check-bg);
  border-radius:var(--radius);
  text-align:center;
  max-height:0;
  overflow:hidden;
  opacity:0;
  transition:max-height 0.3s ease,opacity 0.3s ease,margin 0.3s ease,padding 0.3s ease;
  margin-bottom:0;
  padding-top:0;
  padding-bottom:0;
}
.timer-widget.timer-open{
  max-height:200px;
  opacity:1;
  margin-bottom:2rem;
  padding:1rem 1.25rem;
}
}
.timer-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:0.5rem;
}
.timer-label{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:0.7rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--text-muted);
}
.timer-display{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:2.75rem;
  font-weight:700;
  letter-spacing:-0.03em;
  line-height:1;
  margin-bottom:0.75rem;
  color:var(--text);
}
.timer-done{color:var(--accent);animation:pulse 1s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}
.timer-controls{
  display:flex;
  gap:0.5rem;
}
.timer-btn{
  flex:1;
  padding:0.4rem 0;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surface);
  font-family:'Poppins',system-ui,sans-serif;
  font-size:0.7rem;
  cursor:pointer;
  color:var(--text-muted);
  transition:background 0.15s,color 0.15s,border-color 0.15s;
}
.timer-running #timer-toggle{
  border-color:var(--accent);
  background:var(--accent);
  color:#fff;
}
.timer-btn:active{transform:scale(0.96)}

.tmr{font-weight:500;cursor:pointer;transition:color 0.2s;white-space:nowrap}
.tmr:hover{color:var(--accent)}
.tmr::before{content:"⏲";font-size:0.8em;margin-right:0.4em}

.cook-link{
  font-family:'SF Mono','Fira Code','Cascadia Code',monospace;
  font-size:0.7rem;
  color:var(--text-muted);
  background:var(--check-bg);
  padding:0.15rem 0.4rem;
  border-radius:4px;
  text-decoration:none;
  vertical-align:middle;
  margin-left:0.4rem;
  transition:all 0.15s;
}
.cook-link:hover{color:var(--accent);background:var(--border);text-decoration:none}

.actions{
  display:flex;
  gap:0.75rem;
  flex-wrap:wrap;
  margin-top:2rem;
}
.actions a,.actions button{
  padding:0.6rem 1.2rem;
  border-radius:var(--radius);
  font-size:0.9rem;
  font-family:'Poppins',system-ui,sans-serif;
  cursor:pointer;
  text-decoration:none;
  transition:all 0.2s;
  display:inline-flex;
  align-items:center;
  gap:0.4rem;
}
.btn-primary{background:var(--accent);color:#fff;border:none}
.btn-primary:hover{background:var(--accent-hover);text-decoration:none}
.btn-secondary{background:var(--surface);color:var(--text);border:1px solid var(--border)}
.btn-secondary:hover{border-color:var(--accent);text-decoration:none}

.error-box{
  text-align:center;
  padding:3rem 1.5rem;
}
.error-box h3{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:1.1rem;
  font-weight:600;
  color:var(--text);
  margin-bottom:0.5rem;
}
.error-box p{
  font-size:0.9rem;
  color:var(--text-muted);
  margin-bottom:1.25rem;
  word-break:break-word;
}
.error-source{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
}
.error-source a{
  color:var(--text);
  text-decoration:none;
}
.error-source a:hover{
  color:var(--accent);
  text-decoration:underline;
}
.error-source a:hover .source-path{
  color:var(--accent);
}

.loading-box{
  text-align:center;
  padding:4rem 1.5rem;
}
.loading-box h3{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:1.1rem;
  font-weight:600;
  color:var(--text);
  margin-bottom:0.5rem;
}
.loading-status{
  font-size:0.9rem;
  color:var(--text-muted);
  margin-bottom:0.35rem;
}
.loading-source{
  font-size:0.8rem;
  font-family:'Poppins',system-ui,sans-serif;
}
.loading-source a{
  color:var(--text);
  text-decoration:none;
}
.loading-source a:hover{
  color:var(--accent);
  text-decoration:underline;
}
.loading-source a:hover .source-path{
  color:var(--accent);
}
.loading-spinner{
  width:32px;
  height:32px;
  border:3px solid var(--border);
  border-top-color:var(--accent);
  border-radius:50%;
  margin:0 auto 1.5rem;
  animation:spin 0.8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

.bookmarklet{
  margin-top:2rem;
  padding:1rem;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
}
.bookmarklet h4{font-size:0.9rem;margin-bottom:0.5rem;font-family:system-ui,sans-serif}
.bookmarklet p{font-size:0.85rem;color:var(--text-muted);margin-bottom:0.5rem}
.bookmarklet code{
  display:block;
  padding:0.5rem;
  background:var(--check-bg);
  border-radius:4px;
  font-size:0.75rem;
  word-break:break-all;
}

@media(max-width:600px){
  .page{padding:0 1rem 2rem}
  nav{padding:1rem}
  footer{padding:1rem}
  .hero h1{font-size:1.8rem}
  .hero{padding:1.5rem 0 0.5rem}
  .search-form form{flex-direction:column}
  .search-form button{width:100%}
  .recipe-header h2{font-size:1.4rem}
  .recipe-meta{font-size:0.8rem}
  .recipe-meta span{margin-right:0.5rem}
  .recipe-image{max-height:250px}
  .recent-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  .actions{flex-direction:column}
  .actions a,.actions button{width:100%;justify-content:center}
  .timer-display{font-size:2.25rem}
  .instruction-list li{padding-left:1.5rem}
}

.cook-header{margin-bottom:1rem}
.cook-back{color:var(--text-muted);font-size:0.85rem;font-family:'Poppins',system-ui,sans-serif}
.cook-back:hover{color:var(--accent)}
.cook-header h2{font-family:'Poppins',system-ui,sans-serif;font-size:0.95rem;font-weight:500;color:var(--text-muted);margin-top:0.25rem}
.cook-filename{color:var(--text-muted);text-decoration:none;font-weight:500;display:inline-flex;align-items:center;gap:0.3rem}
.cook-filename:hover{color:var(--accent);text-decoration:underline}
.cook-filename svg{flex-shrink:0}
.cook-copy-btn{
  position:absolute;
  top:0.5rem;
  right:0.5rem;
  padding:0.4rem;
  border:1px solid #3c3c3c;
  border-radius:6px;
  background:#2d2d2d;
  color:#999;
  cursor:pointer;
  transition:all 0.15s;
  opacity:0;
}
.cook-viewer:hover .cook-copy-btn{opacity:1}
.cook-copy-btn:hover{border-color:var(--accent);color:var(--accent)}
.cook-copy-done{border-color:#22c55e!important;color:#22c55e!important;opacity:1!important}

.cook-viewer{
  position:relative;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#1e1e1e;
  overflow-x:auto;
}
.cook-code{
  padding:1.25rem;
  margin:0;
  font-family:'SF Mono','Fira Code','Cascadia Code',monospace;
  font-size:0.85rem;
  line-height:1.65;
  color:#d4d4d4;
  white-space:pre;
  overflow-x:auto;
}
.cook-code .ck-delim{color:#6a9955;font-weight:600}
.cook-code .ck-key{color:#9cdcfe}
.cook-code .ck-val{color:#ce9178}
.cook-code .ck-section{color:#569cd6;font-weight:600}
.cook-code .ck-ing{color:#4ec9b0}
.cook-code .ck-tmr{color:#dcdcaa}
.cook-code .ck-qty{color:#b5cea8}
.cook-code .ck-unit{color:#ce9178}

.recent-recipes{margin-top:1.5rem}
.recent-recipes h3{
  font-size:0.85rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--text-muted);
  border-bottom:2px solid var(--border);
  padding-bottom:0.35rem;
  margin-bottom:0.75rem;
  font-family:'Poppins',system-ui,sans-serif;
}
.recent-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(200px,1fr));
  gap:1rem;
}
.recent-card{
  display:block;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  text-decoration:none;
  color:var(--text);
  transition:border-color 0.2s,box-shadow 0.2s;
  background:var(--surface);
}
.recent-card:hover{
  border-color:var(--accent);
  box-shadow:0 2px 8px rgba(0,0,0,0.06);
  text-decoration:none;
}
.recent-card img{
  width:100%;
  height:130px;
  object-fit:cover;
}
.recent-card-body{
  padding:0.65rem 0.75rem;
  display:flex;
  flex-direction:column;
  gap:0.15rem;
}
.recent-card-name{
  font-size:0.9rem;
  font-weight:500;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.recent-card-domain{
  font-size:0.75rem;
  color:var(--text-muted);
  font-family:'Poppins',system-ui,sans-serif;
}
.recent-card:hover .recent-card-name{color:var(--accent)}

.userscript-install{padding:2.5rem 0 1rem;text-align:center}
.userscript-install h2{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:2rem;
  font-weight:700;
  letter-spacing:-0.02em;
  margin-bottom:0.5rem;
}
.userscript-desc{color:var(--text-muted);font-size:1.05rem;margin-bottom:2rem}
.install-btn{
  display:inline-block;
  padding:0.85rem 2rem;
  border-radius:var(--radius);
  background:var(--accent);
  color:#fff;
  border:none;
  font-size:1.1rem;
  font-family:'Poppins',system-ui,sans-serif;
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
  transition:background 0.2s;
  margin-bottom:2.5rem;
}
.install-btn:hover{background:var(--accent-hover);text-decoration:none}
.userscript-section{
  text-align:left;
  max-width:540px;
  margin:0 auto 2rem;
}
.userscript-section h3{
  font-size:0.85rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--text-muted);
  border-bottom:2px solid var(--border);
  padding-bottom:0.35rem;
  margin-bottom:0.75rem;
  font-family:'Poppins',system-ui,sans-serif;
}
.userscript-section p{font-size:0.95rem;color:var(--text-muted);line-height:1.6}
.userscript-section ol{margin:0.5rem 0;padding-left:1.5rem;color:var(--text-muted);font-size:0.95rem;line-height:1.8}
.userscript-section li{margin-bottom:0.25rem}
.userscript-managers{
  display:flex;
  gap:0.75rem;
  margin:0.75rem 0 1rem;
}
.manager-card{
  display:flex;
  flex-direction:column;
  gap:0.15rem;
  padding:0.75rem 1rem;
  border:1px solid var(--border);
  border-radius:var(--radius);
  text-decoration:none;
  transition:border-color 0.2s,box-shadow 0.2s;
  flex:1;
}
.manager-card:hover{border-color:var(--accent);text-decoration:none;box-shadow:0 2px 8px rgba(0,0,0,0.06)}
.manager-card strong{color:var(--text);font-family:'Poppins',system-ui,sans-serif;font-size:0.9rem}
.manager-card span{color:var(--text-muted);font-size:0.8rem}

@media(max-width:600px){
  .userscript-install h2{font-size:1.5rem}
  .userscript-managers{flex-direction:column}
}