*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Segoe UI',Arial,sans-serif;background:#f0f2f5;color:#222;min-height:100vh}
header{background:linear-gradient(135deg,#1a73e8,#0d47a1);color:#fff;padding:14px 24px;display:flex;align-items:center;gap:14px;box-shadow:0 2px 8px rgba(0,0,0,.25)}
header h1{font-size:22px;font-weight:700}
header span{font-size:13px;opacity:.8}
.header-right{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:13px}
.header-right .user-email{opacity:.9;margin-right:2px;white-space:nowrap;color:#fff;text-decoration:none}
.header-right .user-email:hover{text-decoration:underline}
.btn-header{background:rgba(255,255,255,.16);color:#fff;border:1px solid rgba(255,255,255,.35)}
.btn-header:hover{background:rgba(255,255,255,.28)}
.layout-item{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;background:#fafbff;border:1px solid #e8eeff;border-radius:8px;margin-bottom:8px}
.layout-item .li-name{font-weight:600;font-size:13px}
.layout-item .li-meta{font-size:11px;color:#888;margin-top:2px}
.global-notice{padding:10px 24px;font-size:13px;text-align:center;border-radius:0;margin:0}
.verify-banner{background:#fff3e0;color:#e65100;border-bottom:1.5px solid #ffe0b2;padding:9px 24px;font-size:13px;display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap}
.verify-banner button{background:#e65100;color:#fff;border:none;padding:5px 12px;border-radius:6px;font-size:12px;cursor:pointer;font-weight:600}
.verify-banner button:hover{background:#bf360c}
.verify-banner button:disabled{opacity:.6;cursor:default}
.plan-badge{padding:3px 9px;border-radius:12px;font-size:11px;font-weight:700;white-space:nowrap}
.plan-badge.plan-free{background:rgba(255,255,255,.18);color:#fff}
.plan-badge.plan-pro{background:#ffd54f;color:#7a4f01}
.plan-compare{display:flex;gap:10px;margin-bottom:14px}
.plan-col{flex:1;background:#fafbff;border:1.5px solid #e8eeff;border-radius:8px;padding:12px}
.plan-col.is-pro{background:#fff8e1;border-color:#ffe082}
.plan-col h4{font-size:12px;margin-bottom:6px}
.plan-col ul{list-style:none;font-size:11.5px;color:#555;line-height:1.7}
.tariff-list{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}
.tariff-opt{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1.5px solid #e0e0e0;border-radius:8px;cursor:pointer;font-size:13px;transition:border-color .15s,background .15s}
.tariff-opt:hover{border-color:#90caf9}
.tariff-opt.selected{border-color:#1a73e8;background:#e8f0fe}
.tariff-opt input{margin:0;flex-shrink:0}
.tariff-opt .t-label{flex:1;font-weight:600}
.tariff-opt .t-price{font-weight:700;color:#1a73e8}
.tariff-opt .t-badge{font-size:10px;background:#43a047;color:#fff;padding:1px 6px;border-radius:8px;margin-left:6px}
.main{display:grid;grid-template-columns:320px 1fr;gap:16px;padding:16px;max-width:1600px;margin:0 auto}
.card{background:#fff;border-radius:10px;box-shadow:0 1px 6px rgba(0,0,0,.1);padding:16px}
.card h2{font-size:12px;font-weight:700;color:#1a73e8;margin-bottom:12px;text-transform:uppercase;letter-spacing:.6px;border-bottom:2px solid #e8f0fe;padding-bottom:8px}
.field{margin-bottom:10px}
.field label{font-size:12px;font-weight:600;color:#555;display:block;margin-bottom:4px}
.field input{border:1.5px solid #ddd;border-radius:6px;padding:7px 10px;font-size:13px;width:100%;transition:border .2s}
.field input:focus{outline:none;border-color:#1a73e8}
.hint{font-size:11px;color:#999;margin-top:3px}
table{width:100%;border-collapse:collapse;font-size:13px}
table th{background:#f8f9ff;color:#555;font-weight:600;padding:8px 6px;text-align:left;font-size:12px;border-bottom:2px solid #e0e0e0}
table td{padding:5px 3px;border-bottom:1px solid #f0f0f0;vertical-align:middle}
table tr:hover td{background:#fafbff}
table input{width:100%;border:1.5px solid #e0e0e0;border-radius:5px;padding:5px 6px;font-size:13px}
table input:focus{outline:none;border-color:#1a73e8}
.btn{display:inline-flex;align-items:center;gap:5px;padding:7px 13px;border:none;border-radius:7px;cursor:pointer;font-size:13px;font-weight:600;transition:all .15s}
.btn-primary{background:#1a73e8;color:#fff}.btn-primary:hover{background:#1558b0}
.btn-danger{background:#ff5252;color:#fff}.btn-danger:hover{background:#d32f2f}
.btn-success{background:#43a047;color:#fff}.btn-success:hover{background:#2e7d32}
.btn-gray{background:#eee;color:#555}.btn-gray:hover{background:#ddd}
.btn-sm{padding:4px 9px;font-size:12px}
.row-btns{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.calc-btn{width:100%;padding:13px;font-size:15px;font-weight:700;border-radius:8px;margin-top:14px}
.calc-btn:disabled{opacity:.6;cursor:default}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:10px}
.stat-box{background:#f8f9ff;border-radius:8px;padding:12px;text-align:center;border:1.5px solid #e0e8ff}
.stat-val{font-size:20px;font-weight:700;color:#1a73e8}
.stat-label{font-size:11px;color:#777;margin-top:3px}
.result-bar{margin-bottom:12px;background:#fafbff;border-radius:8px;border:1px solid #e8eeff;overflow:hidden}
.bar-header{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background:#e8f0fe;font-size:12px;font-weight:600;color:#333;flex-wrap:wrap;gap:4px}
.bar-visual{padding:10px 12px 6px}
.bar-track{height:36px;border-radius:6px;overflow:hidden;display:flex;background:#e0e0e0;margin-bottom:4px}
.seg{display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:#fff;overflow:hidden;white-space:nowrap;cursor:default;flex-shrink:0;border-right:1.5px solid #fff}
.seg:last-child{border-right:none}
.seg:hover{filter:brightness(1.1)}
.seg-endcut{background:#9e9e9e}
.seg-kerf{background:#333}
.seg-waste{background:#e0e0e0;color:#aaa;font-size:10px;flex:0 0 auto}
.bar-labels{position:relative;height:14px;margin-bottom:2px;font-size:10px;color:#666;font-weight:600}
.bar-label-tick{position:absolute;transform:translateX(-50%)}
.bar-info{font-size:11px;color:#888;padding:0 2px 4px}
.empty-state{text-align:center;padding:50px;color:#aaa}
.empty-state p{font-size:14px;margin-top:12px;line-height:1.6}
.alert{padding:10px 14px;border-radius:7px;font-size:13px;margin-bottom:10px;line-height:1.8}
.alert-warn{background:#fff3e0;border:1.5px solid #ffb74d;color:#e65100}
.alert-ok{background:#e8f5e9;border:1.5px solid #81c784;color:#2e7d32}
.tab-row{display:flex;gap:2px;margin-bottom:12px}
.tab{padding:7px 16px;border:none;background:#eef2ff;border-radius:6px 6px 0 0;cursor:pointer;font-size:13px;font-weight:600;color:#888;transition:all .15s}
.tab.active{background:#1a73e8;color:#fff}
.text-output{font-family:'Consolas',monospace;font-size:12px;background:#1e1e2e;color:#cdd6f4;padding:16px;border-radius:8px;white-space:pre-wrap;max-height:480px;overflow-y:auto;line-height:1.7}
.top-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:700}
.badge-green{background:#e8f5e9;color:#2e7d32}
.badge-red{background:#ffebee;color:#c62828}
.badge-blue{background:#e3f2fd;color:#1565c0}
.badge-orange{background:#fff3e0;color:#e65100}
.pieces-legend{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:#444;background:#f5f5f5;padding:5px 10px;border-radius:6px}
.legend-dot{width:14px;height:14px;border-radius:3px;flex-shrink:0}
.right-panel{display:flex;flex-direction:column;gap:0}
.site-footer{text-align:center;padding:20px 16px;font-size:12px;color:#999}
.site-footer a{color:#1a73e8;text-decoration:none}
.site-footer a:hover{text-decoration:underline}
@media print{
  .no-print{display:none !important}
  body{background:#fff}
  .main{display:block;padding:0}
  .card{box-shadow:none;padding:0}
  *{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important;color-adjust:exact !important}
}
