/* Triangle Calculator — style.css v1.0 */

.tric-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
}

/* Header */
.tric-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.tric-icon   { font-size: 36px; line-height: 1; color: #166534; }
.tric-title  {
    font-size: 22px !important; font-weight: 600 !important;
    margin: 0 0 3px !important; padding: 0 !important;
    border: none !important; color: #1a1a1a !important;
}
.tric-sub { font-size: 13px; color: #666; margin: 0; }

/* Tabs */
.tric-tabs {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.tric-tab {
    padding: 8px 14px; font-size: 13px; font-weight: 600;
    border: 1px solid #d0d0d0; border-radius: 8px;
    background: #fff; color: #555; cursor: pointer;
    transition: background .13s, color .13s, border-color .13s;
    min-width: 52px; text-align: center;
}
.tric-tab:hover:not(.act) { background: #f0fdf4; }
.tric-tab.act { background: #dcfce7; color: #166534; border-color: #86efac; }

/* Mode description */
.tric-mode-desc {
    font-size: 13px; color: #555; background: #f0fdf4;
    border: 1px solid #86efac; border-radius: 8px;
    padding: 9px 14px; margin-bottom: 16px;
}
.tric-warn { color: #b45309; font-size: 12px; }

/* Reference diagram */
.tric-ref-diagram { text-align: center; margin-bottom: 16px; }
.tric-ref-svg { width: 100%; max-width: 280px; height: auto; }

/* Panels */
.tric-panel { display: none; }
.tric-panel.act { display: block; }

/* Section label */
.tric-section-lbl {
    font-size: 11px; font-weight: 700; color: #999;
    text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}

/* Grid */
.tric-grid3 {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 12px; margin-bottom: 16px;
}
@media (max-width: 480px) { .tric-grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 340px) { .tric-grid3 { grid-template-columns: 1fr; } }

.tric-lbl {
    display: block; font-size: 12.5px; font-weight: 500;
    color: #555; margin-bottom: 5px;
}

/* Inputs */
.tric-iw { position: relative; }
.tric-iw input[type="number"] {
    width: 100%; box-sizing: border-box;
    padding: 9px 28px 9px 10px;
    border: 1px solid #d0d0d0; border-radius: 8px;
    font-size: 14px; color: #1a1a1a; background: #fff;
    outline: none; transition: border-color .15s;
    -moz-appearance: textfield;
}
.tric-iw input::-webkit-inner-spin-button,
.tric-iw input::-webkit-outer-spin-button { -webkit-appearance: none; }
.tric-iw input:focus { border-color: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.1); }
.tric-suf {
    position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #999; pointer-events: none;
}

/* SVG diagram */
.tric-diagram-wrap { text-align: center; margin-top: 20px; }
#tric-svg-wrap svg { max-width: 100%; height: auto; }

/* Solution table */
table.tric-table {
    width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px;
}
table.tric-table th {
    padding: 8px 10px; text-align: left; color: #888;
    font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid #e8e8e8; background: #fafafa; font-weight: 600;
}
table.tric-table th:last-child { text-align: right; }
table.tric-table td {
    padding: 8px 10px; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
table.tric-table td:last-child { text-align: right; font-weight: 600; font-family: monospace; font-size: 14px; }
table.tric-table tr.tric-given td { background: #f0fdf4; }
table.tric-table tr.tric-given td:first-child::after { content: ' ★'; color: #22C55E; font-size: 10px; }
table.tric-table tr:last-child td { border-bottom: none; }

/* Derived properties grid */
.tric-derived-grid {
    display: grid; grid-template-columns: repeat(3,1fr);
    gap: 10px; margin-bottom: 14px;
}
@media (max-width: 440px) { .tric-derived-grid { grid-template-columns: 1fr 1fr; } }

.tric-derived-card {
    background: #f8f8f8; border: 1px solid #e8e8e8;
    border-radius: 9px; padding: 10px 12px; text-align: center;
}
.tric-derived-val { font-size: 16px; font-weight: 700; color: #166534; margin-bottom: 3px; }
.tric-derived-lbl { font-size: 11px; color: #888; }

/* Steps */
.tric-steps-wrap {
    background: #fafafa; border: 1px solid #e8e8e8;
    border-radius: 10px; overflow: hidden; margin-bottom: 14px;
}
.tric-step {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.tric-step:last-child { border-bottom: none; }
.tric-step-num {
    width: 24px; height: 24px; border-radius: 50%;
    background: #22C55E; color: #fff;
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}
.tric-step-body { flex: 1; }
.tric-step-title { font-size: 13px; font-weight: 600; color: #1a1a1a; margin-bottom: 3px; }
.tric-step-detail { font-size: 13px; color: #555; line-height: 1.6; font-family: monospace; }

/* Triangle type badge */
.tric-type-badge {
    display: inline-block; padding: 3px 12px; border-radius: 12px;
    font-size: 12px; font-weight: 600; margin-top: 4px;
}
.tric-badge-acute    { background: #dcfce7; color: #166534; }
.tric-badge-obtuse   { background: #fef3c7; color: #92400E; }
.tric-badge-right    { background: #dbeafe; color: #1e40af; }
.tric-badge-equilateral { background: #f3e8ff; color: #6B21A8; }
.tric-badge-isosceles   { background: #fce7f3; color: #9D174D; }
.tric-badge-scalene     { background: #f0f4f8; color: #374151; }

/* Error box */
.tric-error-box {
    background: #fee2e2; border: 1px solid #fca5a5;
    border-radius: 9px; padding: 12px 16px; margin-top: 14px;
    font-size: 13px; color: #991b1b;
}

/* Reset */
.tric-reset-btn {
    display: block; width: 100%; margin-top: 10px; padding: 9px;
    font-size: 13px; color: #999; background: none;
    border: 1px solid #e8e8e8; border-radius: 8px;
    cursor: pointer; transition: background .13s;
}
.tric-reset-btn:hover { background: #f5f5f5; color: #333; }
