:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --card: #fffefa;
  --ink: #203d3b;
  --muted: #78817a;
  --line: #e5e5da;
  --teal: #285d52;
  --teal-dark: #143f39;
  --coral: #df896c;
  --coral-dark: #be674e;
  --soft-green: #edf2e8;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 2% 25%, #eeeee0 0, transparent 38%), var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a, input, select { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #d88c62; outline-offset: 4px; }
button { color: inherit; }
svg { vertical-align: middle; }
a { color: var(--teal); text-underline-offset: 4px; }
[hidden] { display: none !important; }
::selection { color: #173c36; background: #dce8cf; }

.app-shell { width: min(1440px, calc(100% - 104px)); margin: 0 auto; }
.site-header { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #c9d6c9; border-radius: 50%; color: var(--teal); background: #edf0e3; font-size: 23px; }
.brand-icon svg { width: 26px; height: 26px; }
.brand-title { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 23px; letter-spacing: -.8px; line-height: 1.15; }
.brand-kicker { display: block; font-size: 8px; letter-spacing: 2.4px; color: var(--muted); text-transform: uppercase; margin-top: 5px; font-weight: 600; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 11px 18px; border: 1px solid transparent; border-radius: 7px; background: var(--card); font-size: 12px; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s; }
.button svg { width: 16px; height: 16px; flex-shrink: 0; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button.primary { color: #fffdf6; background: var(--teal); border-color: var(--teal); box-shadow: 0 3px 4px #254e4112; }
.button.primary:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); box-shadow: 0 4px 12px #254e4124; }
.button.secondary { border-color: #d9dfd3; background: #fffdf7; }
.button.secondary:hover:not(:disabled) { background: #edf2e8; border-color: #b7c9b8; }
.button.ghost { background: transparent; color: #6b7970; }
.button.ghost:hover:not(:disabled) { background: #eceee4; color: var(--ink); }
.button.danger { color: #a85b4e; border-color: #ead2c8; background: #fff8f1; }
.button.danger:hover:not(:disabled) { background: #f6e8df; }
.button.small { min-height: 33px; padding: 8px 12px; font-size: 11px; }
.icon-button { min-width: 36px; width: 36px; min-height: 36px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; display: inline-grid; place-items: center; }
.icon-button:hover { background: #edf2e8; }

.intro { position: relative; padding: 44px 0 31px; }
.eyebrow, .section-kicker { font-size: 9px; text-transform: uppercase; font-weight: 600; letter-spacing: 2.1px; color: #8a957f; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.eyebrow::before { content: ""; height: 1px; width: 22px; background: #9ba98b; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 13px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(36px, 3.8vw, 55px); line-height: 1.12; letter-spacing: -2px; color: #233e36; }
h1 em { font-weight: 400; color: #70836d; }
.intro-copy { color: #7d8277; font-size: 13px; line-height: 1.8; max-width: 620px; margin-bottom: 0; }
.live-pill { position: absolute; right: 0; bottom: 38px; display: inline-flex; align-items: center; gap: 8px; color: #72816e; background: #eff1e6; border: 1px solid #e0e5d6; border-radius: 30px; padding: 8px 13px; font-size: 10px; white-space: nowrap; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7b9f70; box-shadow: 0 0 0 3px #7b9f7014; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 26px; align-items: start; }
.tank-panel { min-width: 0; }
.tank-topline { display: flex; align-items: center; justify-content: space-between; padding: 19px 23px; gap: 18px; background: var(--card); border: 1px solid var(--line); border-bottom: none; border-radius: 12px 12px 0 0; }
.tank-title { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; letter-spacing: -.3px; margin: 0 0 5px; }
.tank-subtitle { font-size: 10px; color: #869084; margin: 0; }
.tank-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; padding: 5px 8px; color: #6b7d68; background: #eff3e8; font-size: 9px; font-weight: 500; white-space: nowrap; }
.badge svg { width: 11px; height: 11px; }
.tank-viewport { position: relative; overflow: hidden; background: #0c3540; padding: 10px; border: 1px solid #153f45; box-shadow: inset 0 0 0 3px #d6e0d00a, 0 17px 30px -23px #103e3e88; }
.tank-viewport::after { content: ""; position: absolute; inset: 9px; border: 1px solid #d7eee51c; pointer-events: none; border-radius: 4px; }
.tank-viewport > svg { width: 100%; height: auto; display: block; }
.tank-footer { background: #fcfbf5; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 19px; min-height: 55px; }
.tank-message { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #849180; line-height: 1.6; margin: 0; }
.tank-message svg { width: 13px; height: 13px; flex-shrink: 0; }
.tank-tools { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.tank-tools .button { font-size: 10px; min-height: 29px; padding: 6px 9px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.stat-card { position: relative; padding: 18px 17px 15px; border: 1px solid var(--line); border-radius: 9px; background: #fdfcf7; }
.stat-label { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; color: #879080; font-size: 10px; }
.stat-label svg { width: 13px; height: 13px; }
.stat-value { display: flex; align-items: baseline; gap: 6px; font-size: 22px; font-family: Georgia, "Times New Roman", serif; line-height: 1.1; color: #365748; }
.stat-value small, .stat-value span { font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; font-size: 9px; font-weight: 400; color: #93998c; }
.meter { margin-top: 12px; height: 4px; overflow: hidden; background: #eaede2; border-radius: 10px; }
.meter-fill { width: 0; height: 100%; background: #8cae81; border-radius: inherit; transition: width .6s ease, background .4s; }
.stat-card:nth-child(2) .meter-fill { background: #b1b886; }
.stat-card:nth-child(3) .meter-fill { background: #d7aa81; }
.care-actions { display: flex; gap: 10px; margin-top: 17px; }
.care-actions .button { flex: 1; background: #fffdf7; border-color: #dbdfd1; min-height: 43px; }
.care-actions .button:first-child { color: #9d6947; background: #f9eee2; border-color: #eddbc6; }
.care-actions .button:hover { background: #e9eee1; }
.care-actions .button:first-child:hover { background: #f2e3cf; }

.control-panel { padding: 23px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 24px #343b2505; }
.panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 19px; }
.panel-heading h2, .panel-heading h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 20px; letter-spacing: -.5px; margin: 0; }
.panel-heading .section-kicker { margin-bottom: 4px; display: block; font-size: 8px; letter-spacing: 1.5px; }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid #dfe5d6; border-radius: 50%; background: #f2f4ea; color: #7e9174; font-family: Georgia, serif; font-size: 12px; }
.tabs { display: flex; gap: 3px; background: #f1f2e9; padding: 4px; border-radius: 7px; margin: 0 0 19px; }
.tab { display: flex; justify-content: center; align-items: center; gap: 7px; flex: 1; padding: 9px 10px; border: 1px solid transparent; border-radius: 5px; font-size: 11px; background: transparent; color: #8a9081; transition: background .2s, box-shadow .2s; }
.tab svg { width: 14px; height: 14px; }
.tab.active, .tab[aria-selected="true"] { color: var(--teal); background: #fffefa; border-color: #e4e6d9; box-shadow: 0 1px 3px #233c3110; }
.field-label { display: flex; align-items: center; justify-content: space-between; color: #687560; font-size: 10px; font-weight: 600; margin-bottom: 10px; }
.breed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 19px; }
.breed-option { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 104px; padding: 12px 7px 10px; border: 1px solid #e6e8dc; border-radius: 7px; background: #fffefa; transition: background .2s, border-color .2s, box-shadow .2s; }
.breed-option:hover { background: #f7f7ef; border-color: #bfccba; }
.breed-option.selected, .breed-option[aria-pressed="true"] { background: #eff4e9; border-color: #91ab83; box-shadow: inset 0 0 0 .5px #91ab83; }
.breed-option.selected::after { content: "✓"; position: absolute; top: 5px; right: 7px; font-size: 9px; color: #78906c; }
.breed-icon { display: grid; place-items: center; width: 60px; height: 37px; margin-bottom: 6px; font-size: 27px; color: #ba9d65; }
.breed-icon svg { width: 58px; height: 35px; overflow: visible; }
.breed-name { display: block; font-size: 11px; color: #435b45; font-weight: 500; }
.breed-description { display: block; margin-top: 4px; font-size: 8px; color: #929783; line-height: 1.3; }
.color-options { display: flex; gap: 12px; margin: 0 0 21px; padding: 3px; }
.color-option { position: relative; width: 27px; height: 27px; padding: 0; border-radius: 50%; border: 3px solid var(--card); background: var(--swatch, var(--color, #a4cdb0)); box-shadow: 0 0 0 1px #e6e5d9; transition: box-shadow .2s, transform .2s; }
.color-option:hover { transform: scale(1.1); }
.color-option.selected, .color-option[aria-pressed="true"] { box-shadow: 0 0 0 1.5px #648568; }
.color-option.selected::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #263d34; font-size: 12px; text-shadow: 0 1px 2px #fff8; }
.color-option[data-color="mint"] { background: #acd8ba; }
.color-option[data-color="gold"] { background: #edca83; }
.color-option[data-color="coral"] { background: #e9a194; }
.color-option[data-color="lavender"] { background: #c4b8d9; }
.color-option[data-color="sky"] { background: #a4cad9; }
.full-width { width: 100%; }
.helper-text { font-size: 9px; color: #929786; line-height: 1.7; margin: 9px 0 0; }
.control-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 21px; }
.control-section .panel-heading { margin-bottom: 15px; }
.control-section .panel-heading h2, .control-section .panel-heading h3 { font-size: 17px; }
.decor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 15px; }
.decor-option { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1px solid #e2e5d8; background: #fcfcf6; padding: 11px 5px; border-radius: 6px; color: #6f7f67; font-size: 10px; min-height: 75px; }
.decor-option svg { width: 36px; height: 31px; }
.decor-option:hover, .decor-option.selected { background: #edf3e6; border-color: #9db291; }
.placement-hint { padding: 11px 12px; margin-top: 12px; border: 1px dashed #d1dcca; border-radius: 6px; background: #f4f6ed; font-size: 10px; color: #7d8b73; line-height: 1.7; }
.selected-decor { margin-top: 13px; padding: 12px; border: 1px solid #e0e6d6; border-radius: 7px; background: #f7f8f0; font-size: 11px; }
.selected-decor p { margin-bottom: 9px; }
.move-controls { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.move-controls button { display: inline-grid; place-items: center; width: 32px; height: 30px; padding: 3px; border: 1px solid #d9dfd0; border-radius: 5px; background: #fffef9; }
.move-controls button:hover { background: #e7eedf; }
.fish-list { display: flex; flex-direction: column; gap: 1px; }
.fish-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eeeee5; }
.fish-row:last-child { border-bottom: 0; padding-bottom: 0; }
.fish-swatch { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #f0f3e7; color: var(--color, #8cb89c); flex-shrink: 0; font-size: 21px; }
.fish-swatch svg { width: 28px; height: 24px; }
.fish-info { flex: 1; min-width: 0; }
.fish-name { display: block; font-size: 11px; font-weight: 500; color: #4a624d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fish-meta { display: block; font-size: 9px; color: #939b89; margin-top: 3px; }
.remove-button { display: grid; place-items: center; width: 25px; height: 25px; padding: 3px; border: 0; border-radius: 4px; background: transparent; font-size: 15px; color: #a9ad9f; }
.remove-button:hover { background: #f8e9df; color: #b26d54; }
.remove-button svg { width: 13px; height: 13px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { border: 1px solid #e3e5d9; border-radius: 6px; background: #fafbf3; color: #748169; padding: 9px 7px; font-size: 10px; }
.preset-button:hover { border-color: #a8b99a; background: #edf3e7; }

.instructions { margin: 34px 0; padding: 25px 28px; border: 1px solid #e1e4d7; border-radius: 10px; background: #f0f2e7; }
.instructions > h2 { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 400; margin-bottom: 18px; }
.instruction-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.instruction { display: flex; align-items: flex-start; gap: 11px; font-size: 10px; color: #87907b; line-height: 1.8; }
.instruction h3, .instruction strong { color: #586d50; font-size: 11px; font-weight: 600; margin: 0 0 4px; }
.instruction p { margin: 0; }
.instruction-number { width: 24px; height: 24px; border: 1px solid #d6dfcd; color: #7e9471; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, serif; font-size: 11px; margin-top: 2px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 28px 0 0; padding: 22px 0 26px; border-top: 1px solid var(--line); font-size: 9px; color: #949b89; line-height: 1.8; }
.footer p { margin: 0; }
.footer a { color: inherit; }
.status-toast { position: fixed; z-index: 20; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; width: max-content; max-width: calc(100% - 36px); padding: 13px 21px; border: 1px solid #527464; border-radius: 9px; color: #fffdf1; background: #264e43; box-shadow: 0 8px 30px #1b403e26; font-size: 12px; line-height: 1.5; animation: toast-enter .25s ease both; }
.status-toast:empty { display: none; }
@keyframes toast-enter { from { opacity: 0; translate: 0 9px; } to { opacity: 1; translate: 0 0; } }
dialog { width: min(450px, calc(100% - 32px)); padding: 30px; border: 1px solid #dce1d2; border-radius: 13px; color: var(--ink); background: var(--card); box-shadow: 0 25px 90px #153d3c30; }
dialog::backdrop { background: #15352f70; backdrop-filter: blur(5px); }
dialog h2 { font-family: Georgia, serif; font-size: 27px; font-weight: 400; letter-spacing: -.8px; }
dialog p { font-size: 13px; line-height: 1.8; color: #7f8878; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { width: 100%; border: 1px solid #dce1d2; border-radius: 6px; padding: 10px 12px; color: var(--ink); background: #fdfdf7; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #a3a895; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 380px; gap: 30px; }
  .control-panel { padding: 26px; }
  .breed-option { min-height: 110px; }
}
@media (max-width: 1150px) {
  .app-shell { width: calc(100% - 56px); }
  .workspace { grid-template-columns: minmax(0, 1fr) 308px; gap: 20px; }
  .control-panel { padding: 19px; }
  .intro-copy { max-width: 480px; }
  .tank-topline { padding: 16px; }
  .tank-footer { padding: 11px 13px; flex-wrap: wrap; }
  .stat-card { padding: 15px 12px; }
  .tank-badges { gap: 4px; }
}
@media (max-width: 900px) {
  .app-shell { width: calc(100% - 40px); max-width: 760px; }
  .site-header { min-height: 88px; }
  .intro { padding-top: 35px; }
  .intro-copy { max-width: 500px; }
  .live-pill { position: static; margin-top: 17px; }
  .workspace { grid-template-columns: 1fr; gap: 26px; }
  .control-panel { padding: 24px; }
  .breed-grid { grid-template-columns: repeat(4, 1fr); }
  .decor-grid { grid-template-columns: repeat(5, 1fr); }
  .preset-grid { grid-template-columns: repeat(4, 1fr); }
  .instructions { margin-top: 26px; padding: 23px; }
  .instruction-grid { gap: 19px; }
}
@media (max-width: 560px) {
  .app-shell { width: calc(100% - 28px); }
  .site-header { min-height: 80px; gap: 10px; }
  .brand { gap: 8px; }
  .brand-icon { width: 35px; height: 35px; font-size: 20px; }
  .brand-title { font-size: 20px; }
  .brand-kicker { font-size: 6.5px; letter-spacing: 1.5px; }
  .header-actions { gap: 3px; }
  .header-actions .button { padding: 8px; font-size: 10px; min-height: 34px; gap: 5px; }
  .header-actions .button svg { width: 13px; height: 13px; }
  .intro { padding: 29px 0 24px; }
  h1 { font-size: 38px; letter-spacing: -1.7px; }
  .intro-copy { font-size: 12px; line-height: 1.8; }
  .eyebrow { font-size: 8px; letter-spacing: 1.6px; }
  .live-pill { font-size: 9px; padding: 7px 10px; margin-top: 14px; }
  .tank-topline { padding: 15px 13px; gap: 10px; }
  .tank-title { font-size: 18px; }
  .tank-subtitle { font-size: 9px; }
  .badge { padding: 5px; font-size: 8px; }
  .tank-viewport { padding: 6px; }
  .tank-viewport::after { inset: 5px; }
  .tank-footer { gap: 6px; }
  .tank-message { font-size: 9px; }
  .tank-tools { margin-left: auto; }
  .stats-grid { gap: 7px; margin-top: 12px; }
  .stat-card { padding: 13px 10px; }
  .stat-label { font-size: 9px; gap: 4px; margin-bottom: 9px; }
  .stat-label svg { width: 11px; height: 11px; }
  .stat-value { font-size: 22px; gap: 4px; flex-wrap: wrap; }
  .stat-value small, .stat-value span { font-size: 8px; }
  .care-actions { gap: 7px; margin-top: 12px; flex-wrap: wrap; }
  .care-actions .button { padding: 10px 8px; font-size: 11px; }
  .control-panel { padding: 20px 17px; }
  .breed-grid { grid-template-columns: repeat(2, 1fr); }
  .breed-option { min-height: 100px; }
  .decor-grid { grid-template-columns: repeat(3, 1fr); }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .instruction-grid { grid-template-columns: 1fr; gap: 18px; }
  .instruction { font-size: 11px; }
  .instruction h3, .instruction strong { font-size: 12px; }
  .instructions { padding: 21px; margin-bottom: 24px; }
  .footer { margin-top: 20px; align-items: flex-start; flex-direction: column; gap: 4px; font-size: 9px; }
  .modal-actions { flex-wrap: wrap; }
  dialog { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Keep quiet secondary text legible and touch controls easy to reach. */
.intro-copy, .helper-text, .tank-subtitle, .tank-message, .fish-meta,
.breed-description, .instruction, .footer, .placement-hint { color: #606e5b; }
.stat-label, .stat-value small, .live-pill, .badge { color: #56694f; }
.helper-text, .tank-subtitle, .tank-message, .fish-meta, .breed-description,
.footer, .stat-label, .stat-value small, .badge, .live-pill { font-size: 11px; }
.color-option { width: 36px; height: 36px; }
.color-options { gap: 12px; }
.remove-button { width: 36px; height: 36px; color: #6f7a68; }
.move-controls button { width: 44px; height: 44px; }
.preset-button { min-height: 44px; font-size: 12px; }
@media (max-width: 560px) {
  .color-options { gap: 14px; }
  .color-option { width: 40px; height: 40px; }
  .remove-button { width: 44px; height: 44px; }
  .tank-badges .badge:last-child { display: none; }
  .header-actions .button { min-height: 44px; }
}
